-
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Switched editor appearance preferences to be local instead of s…
…ynced (#2870)
- Loading branch information
1 parent
c402b66
commit 594a606
Showing
15 changed files
with
120 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { LocalPrefKey, ApplicationStage } from '@standardnotes/services' | ||
import { Migration } from '@Lib/Migrations/Migration' | ||
import { PrefDefaults, PrefKey } from '@standardnotes/models' | ||
|
||
export class Migration2_209_0 extends Migration { | ||
static override version(): string { | ||
return '2.209.0' | ||
} | ||
|
||
protected registerStageHandlers(): void { | ||
this.registerStageHandler(ApplicationStage.FullSyncCompleted_13, async () => { | ||
await this.migrateSyncedPreferencesToLocal() | ||
|
||
this.markDone() | ||
}) | ||
} | ||
|
||
private async migrateSyncedPreferencesToLocal(): Promise<void> { | ||
this.services.preferences.setLocalValue( | ||
LocalPrefKey.EditorMonospaceEnabled, | ||
this.services.preferences.getValue( | ||
PrefKey.DEPRECATED_EditorMonospaceEnabled, | ||
PrefDefaults[LocalPrefKey.EditorMonospaceEnabled], | ||
), | ||
) | ||
this.services.preferences.setLocalValue( | ||
LocalPrefKey.EditorFontSize, | ||
this.services.preferences.getValue(PrefKey.DEPRECATED_EditorFontSize, PrefDefaults[LocalPrefKey.EditorFontSize]), | ||
) | ||
this.services.preferences.setLocalValue( | ||
LocalPrefKey.EditorLineWidth, | ||
this.services.preferences.getValue( | ||
PrefKey.DEPRECATED_EditorLineWidth, | ||
PrefDefaults[LocalPrefKey.EditorLineWidth], | ||
), | ||
) | ||
this.services.preferences.setLocalValue( | ||
LocalPrefKey.EditorLineHeight, | ||
this.services.preferences.getValue( | ||
PrefKey.DEPRECATED_EditorLineHeight, | ||
PrefDefaults[LocalPrefKey.EditorLineHeight], | ||
), | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.