import { ApplicationStage, StorageKey } from '@standardnotes/services' import { Migration } from '@Lib/Migrations/Migration' export class Migration2_204_8 extends Migration { static override version(): string { return '2.204.8' } protected registerStageHandlers(): void { this.registerStageHandler(ApplicationStage.Launched_10, async () => { await this.migrateHostKeyStoredToWorkspaceIdentified() this.markDone() }) } private async migrateHostKeyStoredToWorkspaceIdentified(): Promise { const existingHostKeyValue = this.services.storageService.getValue(StorageKey.ServerHost) if (existingHostKeyValue === undefined) { return } this.services.storageService.setValue(`${StorageKey.ServerHost}:${this.services.identifier}`, existingHostKeyValue) await this.services.storageService.removeValue(StorageKey.ServerHost) } }