aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/basicAuth/store.js
diff options
context:
space:
mode:
authorLibravatar Markandan R <rmarkandan@yahoo.com>2021-06-22 10:56:34 +0530
committerLibravatar GitHub <noreply@github.com>2021-06-22 10:56:34 +0530
commita94ed659846f0bc93c05bccf0c96785b91e5c78f (patch)
tree0a50eeb85e9043708936da9a0c923b32edbe8ab9 /src/features/basicAuth/store.js
parentDowngraded submodule 'src/internal-server' (diff)
downloadferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.tar.gz
ferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.tar.zst
ferdium-app-a94ed659846f0bc93c05bccf0c96785b91e5c78f.zip
Removed the cyclical dependency (#1519) (#1539)
Diffstat (limited to 'src/features/basicAuth/store.js')
-rw-r--r--src/features/basicAuth/store.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/features/basicAuth/store.js b/src/features/basicAuth/store.js
new file mode 100644
index 000000000..0713ff572
--- /dev/null
+++ b/src/features/basicAuth/store.js
@@ -0,0 +1,30 @@
1import { observable } from 'mobx';
2import { ipcRenderer } from 'electron';
3
4const debug = require('debug')('Ferdi:feature:basicAuth');
5
6const defaultState = {
7 isModalVisible: true,
8 service: null,
9 authInfo: null,
10};
11
12export const state = observable(defaultState);
13
14export function resetState() {
15 Object.assign(state, defaultState);
16}
17export 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
26export function cancelLogin() {
27 debug('Cancel basic auth event');
28
29 ipcRenderer.send('feature-basic-auth-cancel');
30}