diff options
author | 2021-12-18 04:24:10 +0100 | |
---|---|---|
committer | 2021-12-18 04:24:10 +0100 | |
commit | 18494f66a7e0f4020cbc77374d4679421fcf469a (patch) | |
tree | cfd10fb71ca86f4d0580946cee2ccbc8c66dc634 /src/features/nightlyBuilds/index.ts | |
parent | Fix linter (diff) | |
download | ferdium-app-18494f66a7e0f4020cbc77374d4679421fcf469a.tar.gz ferdium-app-18494f66a7e0f4020cbc77374d4679421fcf469a.tar.zst ferdium-app-18494f66a7e0f4020cbc77374d4679421fcf469a.zip |
Refactor autoUpdater usage
Diffstat (limited to 'src/features/nightlyBuilds/index.ts')
-rw-r--r-- | src/features/nightlyBuilds/index.ts | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/features/nightlyBuilds/index.ts b/src/features/nightlyBuilds/index.ts deleted file mode 100644 index 14afbaf1b..000000000 --- a/src/features/nightlyBuilds/index.ts +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | import { state as ModalState } from './store'; | ||
2 | |||
3 | export { default as Component } from './Component'; | ||
4 | |||
5 | const debug = require('debug')('Ferdi:feature:nightlyBuilds'); | ||
6 | |||
7 | const state = ModalState; | ||
8 | |||
9 | export default function initialize() { | ||
10 | debug('Initialize nightlyBuilds feature'); | ||
11 | |||
12 | function showModal() { | ||
13 | state.isModalVisible = true; | ||
14 | } | ||
15 | |||
16 | function toggleFeature() { | ||
17 | if (window['ferdi'].stores.settings.app.nightly) { | ||
18 | window['ferdi'].actions.settings.update({ | ||
19 | type: 'app', | ||
20 | data: { | ||
21 | nightly: false, | ||
22 | }, | ||
23 | }); | ||
24 | window['ferdi'].actions.user.update({ | ||
25 | userData: { | ||
26 | nightly: false, | ||
27 | }, | ||
28 | }); | ||
29 | } else { | ||
30 | // We need to close the settings, otherwise the modal will be drawn under the settings window | ||
31 | window['ferdi'].actions.ui.closeSettings(); | ||
32 | showModal(); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | window['ferdi'].features.nightlyBuilds = { | ||
37 | state, | ||
38 | showModal, | ||
39 | toggleFeature, | ||
40 | }; | ||
41 | } | ||