chore(mobx): add legacy redux migations

This commit is contained in:
Paul
2021-12-21 12:31:14 +00:00
parent 68578d2620
commit f7be9df980
10 changed files with 99 additions and 16 deletions

View File

@@ -12,7 +12,7 @@ import SAudio, { SoundOptions } from "./helpers/SAudio";
import SSecurity from "./helpers/SSecurity";
import STheme from "./helpers/STheme";
interface ISettings {
export interface ISettings {
"notifications:desktop": boolean;
"notifications:sounds": SoundOptions;
@@ -60,8 +60,9 @@ export default class Settings implements Store, Persistent<ISettings> {
}
@action hydrate(data: ISettings) {
Object.keys(data).forEach((key) =>
this.data.set(key, (data as any)[key]),
Object.keys(data).forEach(
(key) =>
(data as any)[key] && this.data.set(key, (data as any)[key]),
);
}