aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/todos')
-rw-r--r--src/features/todos/index.js4
-rw-r--r--src/features/todos/store.js20
2 files changed, 23 insertions, 1 deletions
diff --git a/src/features/todos/index.js b/src/features/todos/index.js
index 00b165cc5..9b6ab00a0 100644
--- a/src/features/todos/index.js
+++ b/src/features/todos/index.js
@@ -9,6 +9,10 @@ export const DEFAULT_TODOS_WIDTH = 300;
9export const TODOS_MIN_WIDTH = 200; 9export const TODOS_MIN_WIDTH = 200;
10export const DEFAULT_TODOS_VISIBLE = true; 10export const DEFAULT_TODOS_VISIBLE = true;
11 11
12export const TODOS_ROUTES = {
13 TARGET: '/todos',
14};
15
12export const todosStore = new TodoStore(); 16export const todosStore = new TodoStore();
13 17
14export default function initTodos(stores, actions) { 18export default function initTodos(stores, actions) {
diff --git a/src/features/todos/store.js b/src/features/todos/store.js
index ea05077ab..5d67c5ba0 100644
--- a/src/features/todos/store.js
+++ b/src/features/todos/store.js
@@ -10,7 +10,9 @@ import { todoActions } from './actions';
10import { FeatureStore } from '../utils/FeatureStore'; 10import { FeatureStore } from '../utils/FeatureStore';
11import { createReactions } from '../../stores/lib/Reaction'; 11import { createReactions } from '../../stores/lib/Reaction';
12import { createActionBindings } from '../utils/ActionBinding'; 12import { createActionBindings } from '../utils/ActionBinding';
13import { DEFAULT_TODOS_WIDTH, TODOS_MIN_WIDTH, DEFAULT_TODOS_VISIBLE } from '.'; 13import {
14 DEFAULT_TODOS_WIDTH, TODOS_MIN_WIDTH, DEFAULT_TODOS_VISIBLE, TODOS_ROUTES,
15} from '.';
14import { IPC } from './constants'; 16import { IPC } from './constants';
15import { state as delayAppState } from '../delayApp'; 17import { state as delayAppState } from '../delayApp';
16 18
@@ -66,6 +68,7 @@ export default class TodoStore extends FeatureStore {
66 this._setFeatureEnabledReaction, 68 this._setFeatureEnabledReaction,
67 this._updateTodosConfig, 69 this._updateTodosConfig,
68 this._firstLaunchReaction, 70 this._firstLaunchReaction,
71 this._routeCheckReaction,
69 ]); 72 ]);
70 73
71 this._registerReactions(this._allReactions); 74 this._registerReactions(this._allReactions);
@@ -176,4 +179,19 @@ export default class TodoStore extends FeatureStore {
176 }); 179 });
177 } 180 }
178 }; 181 };
182
183 _routeCheckReaction = () => {
184 const { pathname } = this.stores.router.location;
185
186 if (pathname === TODOS_ROUTES.TARGET) {
187 debug('Router is on todos route, show todos panel');
188 // todosStore.start(stores, actions);
189
190 if (!this.isTodosPanelVisible) {
191 this._updateSettings({
192 isTodosPanelVisible: true,
193 });
194 }
195 }
196 }
179} 197}