diff options
author | 2022-09-06 22:32:04 +0200 | |
---|---|---|
committer | 2022-09-08 01:24:50 +0200 | |
commit | 5f8f4e6484faff23821ca7c009e309382fba914d (patch) | |
tree | 6d399fb90b4aa3527c30c502ba474cd83b5c94b2 /subprojects/frontend/src/RootStore.tsx | |
parent | feat(frontend): handle page hide events (diff) | |
download | refinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.gz refinery-5f8f4e6484faff23821ca7c009e309382fba914d.tar.zst refinery-5f8f4e6484faff23821ca7c009e309382fba914d.zip |
feat(frontend): check for updates periodically
Diffstat (limited to 'subprojects/frontend/src/RootStore.tsx')
-rw-r--r-- | subprojects/frontend/src/RootStore.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/subprojects/frontend/src/RootStore.tsx b/subprojects/frontend/src/RootStore.tsx index 5aa580d1..c1674a3c 100644 --- a/subprojects/frontend/src/RootStore.tsx +++ b/subprojects/frontend/src/RootStore.tsx | |||
@@ -2,6 +2,7 @@ import { getLogger } from 'loglevel'; | |||
2 | import { makeAutoObservable, runInAction } from 'mobx'; | 2 | import { makeAutoObservable, runInAction } from 'mobx'; |
3 | import React, { createContext, useContext } from 'react'; | 3 | import React, { createContext, useContext } from 'react'; |
4 | 4 | ||
5 | import PWAStore from './PWAStore'; | ||
5 | import type EditorStore from './editor/EditorStore'; | 6 | import type EditorStore from './editor/EditorStore'; |
6 | import ThemeStore from './theme/ThemeStore'; | 7 | import ThemeStore from './theme/ThemeStore'; |
7 | 8 | ||
@@ -10,17 +11,21 @@ const log = getLogger('RootStore'); | |||
10 | export default class RootStore { | 11 | export default class RootStore { |
11 | editorStore: EditorStore | undefined; | 12 | editorStore: EditorStore | undefined; |
12 | 13 | ||
14 | readonly pwaStore: PWAStore; | ||
15 | |||
13 | readonly themeStore: ThemeStore; | 16 | readonly themeStore: ThemeStore; |
14 | 17 | ||
15 | constructor(initialValue: string) { | 18 | constructor(initialValue: string) { |
19 | this.pwaStore = new PWAStore(); | ||
16 | this.themeStore = new ThemeStore(); | 20 | this.themeStore = new ThemeStore(); |
17 | makeAutoObservable(this, { | 21 | makeAutoObservable(this, { |
22 | pwaStore: false, | ||
18 | themeStore: false, | 23 | themeStore: false, |
19 | }); | 24 | }); |
20 | import('./editor/EditorStore') | 25 | import('./editor/EditorStore') |
21 | .then(({ default: EditorStore }) => { | 26 | .then(({ default: EditorStore }) => { |
22 | runInAction(() => { | 27 | runInAction(() => { |
23 | this.editorStore = new EditorStore(initialValue); | 28 | this.editorStore = new EditorStore(initialValue, this.pwaStore); |
24 | }); | 29 | }); |
25 | }) | 30 | }) |
26 | .catch((error) => { | 31 | .catch((error) => { |