feat: Themes and appeareance settings are now local to your device and not synced (#2847)

This commit is contained in:
Aman Harwara
2024-02-17 14:23:37 +05:30
committed by GitHub
parent 3d1a038393
commit bfbf9ab8ce
18 changed files with 250 additions and 117 deletions

View File

@@ -81,6 +81,7 @@ import {
CreateDecryptedBackupFile,
CreateEncryptedBackupFile,
WebSocketsService,
PreferencesServiceEvent,
} from '@standardnotes/services'
import {
SNNote,
@@ -326,8 +327,12 @@ export class SNApplication implements ApplicationInterface, AppGroupManagedAppli
const preferencesService = this.dependencies.get<PreferencesService>(TYPES.PreferencesService)
this.serviceObservers.push(
preferencesService.addEventObserver(() => {
void this.notifyEvent(ApplicationEvent.PreferencesChanged)
preferencesService.addEventObserver((event) => {
if (event === PreferencesServiceEvent.PreferencesChanged) {
void this.notifyEvent(ApplicationEvent.PreferencesChanged)
} else if (event === PreferencesServiceEvent.LocalPreferencesChanged) {
void this.notifyEvent(ApplicationEvent.LocalPreferencesChanged)
}
}),
)

View File

@@ -147,6 +147,7 @@ import {
DesignateSurvivor,
SyncBackoffService,
SyncBackoffServiceInterface,
StorageServiceInterface,
} from '@standardnotes/services'
import { ItemManager } from '../../Services/Items/ItemManager'
import { PayloadManager } from '../../Services/Payloads/PayloadManager'
@@ -1282,6 +1283,7 @@ export class Dependencies {
this.get<ItemManager>(TYPES.ItemManager),
this.get<MutatorService>(TYPES.MutatorService),
this.get<SyncService>(TYPES.SyncService),
this.get<StorageServiceInterface>(TYPES.DiskStorageService),
this.get<InternalEventBus>(TYPES.InternalEventBus),
)
})