Skip to content

Commit

Permalink
add overrideFont key to config migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
charlag committed Apr 21, 2020
1 parent de4e932 commit 1a9ed7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/desktop/config/migrations/DesktopConfigMigrator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @param migrationFunction name of the function to use for migration
* @param oldConfig old config read from disk
* @param defaultConfig default config to use if oldConfig is invalid
* @returns config after aplplication of all migrations
* @returns config after application of all migrations
*/
export default function applyMigrations(migrationFunction: "migrateClient" | "migrateAdmin", oldConfig: any, defaultConfig: any): any {
if (oldConfig == null) oldConfig = {}
Expand All @@ -17,6 +17,8 @@ export default function applyMigrations(migrationFunction: "migrateClient" | "mi
case 0:
oldConfig = applyMigration(require('./migration-0001')[migrationFunction], oldConfig)
case 1:
oldConfig = applyMigration(require('./migration-0002')[migrationFunction], oldConfig)
case 2:
console.log("config up to date")
/* add new migrations as needed */
break;
Expand Down
7 changes: 7 additions & 0 deletions src/desktop/config/migrations/migration-0002.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// @flow
function migrate(oldConfig: any) {
return Object.assign(oldConfig, {"desktopConfigVersion": 2, "overrideFont": null})
}

export const migrateClient = migrate
export const migrateAdmin = migrate

0 comments on commit 1a9ed7b

Please sign in to comment.