diff options
author | Markus Hatvan <markus_hatvan@aon.at> | 2021-09-18 11:15:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-18 11:15:25 +0200 |
commit | d4101a48b3eee8b1fb177831aa02a4b4fbec2588 (patch) | |
tree | c92f2fbe91197fde8589207463d0d6526b4ff76b /src/features/basicAuth/store.ts | |
parent | 5.6.3-nightly.6 [skip ci] (diff) | |
download | ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.tar.gz ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.tar.zst ferdium-app-d4101a48b3eee8b1fb177831aa02a4b4fbec2588.zip |
chore: convert various files from JS to TS (#1959)
Diffstat (limited to 'src/features/basicAuth/store.ts')
-rw-r--r-- | src/features/basicAuth/store.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/features/basicAuth/store.ts b/src/features/basicAuth/store.ts new file mode 100644 index 000000000..0713ff572 --- /dev/null +++ b/src/features/basicAuth/store.ts | |||
@@ -0,0 +1,30 @@ | |||
1 | import { observable } from 'mobx'; | ||
2 | import { ipcRenderer } from 'electron'; | ||
3 | |||
4 | const debug = require('debug')('Ferdi:feature:basicAuth'); | ||
5 | |||
6 | const defaultState = { | ||
7 | isModalVisible: true, | ||
8 | service: null, | ||
9 | authInfo: null, | ||
10 | }; | ||
11 | |||
12 | export const state = observable(defaultState); | ||
13 | |||
14 | export function resetState() { | ||
15 | Object.assign(state, defaultState); | ||
16 | } | ||
17 | export function sendCredentials(user, password) { | ||
18 | debug('Sending credentials to main', user, password); | ||
19 | |||
20 | ipcRenderer.send('feature-basic-auth-credentials', { | ||
21 | user, | ||
22 | password, | ||
23 | }); | ||
24 | } | ||
25 | |||
26 | export function cancelLogin() { | ||
27 | debug('Cancel basic auth event'); | ||
28 | |||
29 | ipcRenderer.send('feature-basic-auth-cancel'); | ||
30 | } | ||