revert: loadWorkspace unexpected behavior (#1172)

This commit is contained in:
Himself65 authored and GitHub committed 2023-02-22 10:44:18 +08:00
1 parent 86346b284e
commit 0b072da346
49 files changed
+1225 -2198

No files matched your search

@@ -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());
};
}