aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/store.js
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-01-14 17:11:27 +0100
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-02-12 13:39:03 +0100
commit84755ddf8b8fb015ee2bfd70e9c4aa50d256f9d0 (patch)
treee680bd3e1aab13fa1e413ca54f2f6d7a27c35b20 /src/features/workspaces/store.js
parentadd workspaces menu item in settings dialog (diff)
downloadferdium-app-84755ddf8b8fb015ee2bfd70e9c4aa50d256f9d0.tar.gz
ferdium-app-84755ddf8b8fb015ee2bfd70e9c4aa50d256f9d0.tar.zst
ferdium-app-84755ddf8b8fb015ee2bfd70e9c4aa50d256f9d0.zip
basic setup of workspaces settings screen
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r--src/features/workspaces/store.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index 4b4e729ed..2b6d55cc7 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -1,6 +1,7 @@
1import { observable, reaction } from 'mobx'; 1import { observable, reaction } from 'mobx';
2import Store from '../../stores/lib/Store'; 2import Store from '../../stores/lib/Store';
3import CachedRequest from '../../stores/lib/CachedRequest'; 3import CachedRequest from '../../stores/lib/CachedRequest';
4import Workspace from '../../models/Workspace';
4 5
5const debug = require('debug')('Franz:feature:workspaces'); 6const debug = require('debug')('Franz:feature:workspaces');
6 7
@@ -18,12 +19,20 @@ export default class WorkspacesStore extends Store {
18 19
19 reaction( 20 reaction(
20 () => this.allWorkspacesRequest.result, 21 () => this.allWorkspacesRequest.result,
21 workspaces => this.setWorkspaces(workspaces), 22 workspaces => this._setWorkspaces(workspaces),
23 );
24 reaction(
25 () => this.allWorkspacesRequest.isExecuting,
26 isExecuting => this._setIsLoading(isExecuting),
22 ); 27 );
23 } 28 }
24 29
25 setWorkspaces = (workspaces) => { 30 _setWorkspaces = (workspaces) => {
26 debug('setting user workspaces', workspaces.slice()); 31 debug('setting user workspaces', workspaces.slice());
27 this.state.workspaces = workspaces; 32 this.state.workspaces = workspaces.map(data => new Workspace(data));
33 };
34
35 _setIsLoading = (isLoading) => {
36 this.state.isLoading = isLoading;
28 }; 37 };
29} 38}