diff options
author | 2019-09-16 12:46:13 +0200 | |
---|---|---|
committer | 2019-09-16 12:46:13 +0200 | |
commit | bf676f8597e5539c047f42a5716022681e3419c3 (patch) | |
tree | c5795bbc48951fdf643838eaa8f3294dff13dba4 /src/features/workspaces/models/Workspace.js | |
parent | Add information about NodeJS version in dev (diff) | |
download | ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.gz ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.tar.zst ferdium-app-bf676f8597e5539c047f42a5716022681e3419c3.zip |
Implement #37
Diffstat (limited to 'src/features/workspaces/models/Workspace.js')
-rw-r--r-- | src/features/workspaces/models/Workspace.js | 14 |
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 @@ | |||
1 | import { observable } from 'mobx'; | 1 | import { observable } from 'mobx'; |
2 | 2 | ||
3 | import { KEEP_WS_LOADED_USID } from '../../../config'; | ||
4 | |||
3 | export default class Workspace { | 5 | export 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 | } |