summaryrefslogtreecommitdiffstats
path: root/src/features/todos/store.js
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-09-05 14:34:13 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-09-05 14:34:13 +0200
commit5336eab8b279eea886d8ce6efb03bd771d65ddc8 (patch)
tree79ebdf1a60ed0f2f1c8de93c90e90d7d2f5dab47 /src/features/todos/store.js
parentMerge branch 'feature/todos' into develop (diff)
parentFix headline spacing (diff)
downloadferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.tar.gz
ferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.tar.zst
ferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.zip
Merge branch 'develop' of https://github.com/meetfranz/franz into develop
Diffstat (limited to 'src/features/todos/store.js')
-rw-r--r--src/features/todos/store.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/features/todos/store.js b/src/features/todos/store.js
index 170408ebb..aebe0dcbe 100644
--- a/src/features/todos/store.js
+++ b/src/features/todos/store.js
@@ -30,7 +30,7 @@ export default class TodoStore extends FeatureStore {
30 } 30 }
31 31
32 @computed get isTodosPanelVisible() { 32 @computed get isTodosPanelVisible() {
33 if (this.stores.services.all.length === 0 || delayAppState.isDelayAppScreenVisible) return false; 33 if (delayAppState.isDelayAppScreenVisible) return false;
34 if (this.settings.isTodosPanelVisible === undefined) return DEFAULT_TODOS_VISIBLE; 34 if (this.settings.isTodosPanelVisible === undefined) return DEFAULT_TODOS_VISIBLE;
35 35
36 return this.settings.isTodosPanelVisible; 36 return this.settings.isTodosPanelVisible;
@@ -62,6 +62,7 @@ export default class TodoStore extends FeatureStore {
62 this._allReactions = createReactions([ 62 this._allReactions = createReactions([
63 this._setFeatureEnabledReaction, 63 this._setFeatureEnabledReaction,
64 this._updateTodosConfig, 64 this._updateTodosConfig,
65 this._firstLaunchReaction,
65 ]); 66 ]);
66 67
67 this._registerReactions(this._allReactions); 68 this._registerReactions(this._allReactions);
@@ -156,5 +157,20 @@ export default class TodoStore extends FeatureStore {
156 _updateTodosConfig = () => { 157 _updateTodosConfig = () => {
157 // Resend the config if any part changes in Franz: 158 // Resend the config if any part changes in Franz:
158 this._onTodosClientInitialized(); 159 this._onTodosClientInitialized();
159 } 160 };
161
162 _firstLaunchReaction = () => {
163 const { stats } = this.stores.settings.all;
164
165 // Hide todos layer on first app start but show on second
166 if (stats.appStarts <= 1) {
167 this._updateSettings({
168 isTodosPanelVisible: false,
169 });
170 } else if (stats.appStarts <= 2) {
171 this._updateSettings({
172 isTodosPanelVisible: true,
173 });
174 }
175 };
160} 176}