aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/models
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-16 12:46:13 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-16 12:46:13 +0200
commitbf676f8597e5539c047f42a5716022681e3419c3 (patch)
treec5795bbc48951fdf643838eaa8f3294dff13dba4 /src/features/workspaces/models
parentAdd information about NodeJS version in dev (diff)
downloadferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.gz
ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.zst
ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.zip
Implement #37
Diffstat (limited to 'src/features/workspaces/models')
-rw-r--r--src/features/workspaces/models/Workspace.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/features/workspaces/models/Workspace.js b/src/features/workspaces/models/Workspace.js
index 6c73d7095..77c4e05f4 100644
--- a/src/features/workspaces/models/Workspace.js
+++ b/src/features/workspaces/models/Workspace.js
@@ -1,5 +1,7 @@
1import { observable } from 'mobx'; 1import { observable } from 'mobx';
2 2
3import { KEEP_WS_LOADED_USID } from '../../../config';
4
3export default class Workspace { 5export default class Workspace {
4 id = null; 6 id = null;
5 7
@@ -19,7 +21,17 @@ export default class Workspace {
19 this.id = data.id; 21 this.id = data.id;
20 this.name = data.name; 22 this.name = data.name;
21 this.order = data.order; 23 this.order = data.order;
22 this.services.replace(data.services); 24
25 let services = data.services;
26 if (data.saving && data.keepLoaded) {
27 // Keep workspaces loaded
28 services.push(KEEP_WS_LOADED_USID);
29 } else if (data.saving && data.services.includes(KEEP_WS_LOADED_USID)) {
30 // Don't keep loaded
31 services = services.filter(e => e !== KEEP_WS_LOADED_USID);
32 }
33 this.services.replace(services);
34
23 this.userId = data.userId; 35 this.userId = data.userId;
24 } 36 }
25} 37}