revert: loadWorkspace unexpected behavior (#1172)

This commit is contained in:
Himself65
2023-02-21 20:44:18 -06:00
committed by GitHub
parent 86346b284e
commit 0b072da346
49 changed files with 1225 additions and 2198 deletions

View File

@@ -2,13 +2,11 @@ import { ThemeMode } from '../types';
export class LocalStorageThemeHelper {
name = 'Affine-theme-mode';
callback = new Set<() => void>();
get = (): ThemeMode | null => {
return localStorage.getItem(this.name) as ThemeMode | null;
};
set = (mode: ThemeMode) => {
localStorage.setItem(this.name, mode);
this.callback.forEach(cb => cb());
};
}