public async Task InitializeAsync() { var state = await treeStateStore.Get(); if (state is null) { state = treeStateFactory.CreateTree(); await treeStateStore.Set(state); } TreeBehaviour = new TreeBehaviourEngine(config, state); }
private static async Task MigrateSettingsAsync() { var legacyStateStore = new LocalStorageLegacyTreeStateStore(config.SettingPrefix); var state = legacyStateStore.Get(); if (state != null) { // migrate to new store await treeStateStore.Set(state); legacyStateStore.RemoveLegacy(); } }