aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/todos/store.js')
-rw-r--r--src/features/todos/store.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/features/todos/store.js b/src/features/todos/store.js
index c1d6a9049..af8519d9c 100644
--- a/src/features/todos/store.js
+++ b/src/features/todos/store.js
@@ -16,6 +16,8 @@ import {
16import { IPC } from './constants'; 16import { IPC } from './constants';
17import { state as delayAppState } from '../delayApp'; 17import { state as delayAppState } from '../delayApp';
18 18
19import UserAgent from '../../models/UserAgent';
20
19const debug = require('debug')('Ferdi:feature:todos:store'); 21const debug = require('debug')('Ferdi:feature:todos:store');
20 22
21export default class TodoStore extends FeatureStore { 23export default class TodoStore extends FeatureStore {
@@ -25,6 +27,8 @@ export default class TodoStore extends FeatureStore {
25 27
26 @observable webview = null; 28 @observable webview = null;
27 29
30 @observable userAgentModel = new UserAgent();
31
28 isInitialized = false; 32 isInitialized = false;
29 33
30 @computed get width() { 34 @computed get width() {
@@ -51,6 +55,10 @@ export default class TodoStore extends FeatureStore {
51 return localStorage.getItem('todos') || {}; 55 return localStorage.getItem('todos') || {};
52 } 56 }
53 57
58 @computed get userAgent() {
59 return this.userAgentModel.userAgent;
60 }
61
54 // ========== PUBLIC API ========= // 62 // ========== PUBLIC API ========= //
55 63
56 @action start(stores, actions) { 64 @action start(stores, actions) {
@@ -123,7 +131,10 @@ export default class TodoStore extends FeatureStore {
123 131
124 @action _setTodosWebview = ({ webview }) => { 132 @action _setTodosWebview = ({ webview }) => {
125 debug('_setTodosWebview', webview); 133 debug('_setTodosWebview', webview);
126 this.webview = webview; 134 if (this.webview !== webview) {
135 this.webview = webview;
136 this.userAgentModel.setWebviewReference(webview);
137 }
127 }; 138 };
128 139
129 @action _handleHostMessage = (message) => { 140 @action _handleHostMessage = (message) => {