diff options
author | 2022-04-22 15:04:21 -0500 | |
---|---|---|
committer | 2022-04-22 20:04:21 +0000 | |
commit | 759d93dc198a3cc8c5265245c0144efa5435682b (patch) | |
tree | 53e963a085d3d12af5a2efa2f1ab6f3e5574edc7 /src/features/todos/store.js | |
parent | Added build scripts for linux, macos and windows to help new contributors get... (diff) | |
download | ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.gz ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.tar.zst ferdium-app-759d93dc198a3cc8c5265245c0144efa5435682b.zip |
Turn off usage of 'debug' npm package using with electron-16 (fixes #17)
Diffstat (limited to 'src/features/todos/store.js')
-rw-r--r-- | src/features/todos/store.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 90ea47c71..41e632b49 100644 --- a/src/features/todos/store.js +++ b/src/features/todos/store.js | |||
@@ -18,7 +18,8 @@ import { createActionBindings } from '../utils/ActionBinding'; | |||
18 | import { IPC, TODOS_ROUTES } from './constants'; | 18 | import { IPC, TODOS_ROUTES } from './constants'; |
19 | import UserAgent from '../../models/UserAgent'; | 19 | import UserAgent from '../../models/UserAgent'; |
20 | 20 | ||
21 | const debug = require('debug')('Ferdium:feature:todos:store'); | 21 | // TODO: Go back to 'debug' from 'console.log' when https://github.com/electron/electron/issues/31689 is fixed |
22 | // const debug = require('debug')('Ferdium:feature:todos:store'); | ||
22 | 23 | ||
23 | export default class TodoStore extends FeatureStore { | 24 | export default class TodoStore extends FeatureStore { |
24 | @observable stores = null; | 25 | @observable stores = null; |
@@ -96,7 +97,7 @@ export default class TodoStore extends FeatureStore { | |||
96 | // ========== PUBLIC API ========= // | 97 | // ========== PUBLIC API ========= // |
97 | 98 | ||
98 | @action start(stores, actions) { | 99 | @action start(stores, actions) { |
99 | debug('TodoStore::start'); | 100 | console.log('TodoStore::start'); |
100 | this.stores = stores; | 101 | this.stores = stores; |
101 | this.actions = actions; | 102 | this.actions = actions; |
102 | 103 | ||
@@ -133,7 +134,7 @@ export default class TodoStore extends FeatureStore { | |||
133 | 134 | ||
134 | @action stop() { | 135 | @action stop() { |
135 | super.stop(); | 136 | super.stop(); |
136 | debug('TodoStore::stop'); | 137 | console.log('TodoStore::stop'); |
137 | this.reset(); | 138 | this.reset(); |
138 | this.isFeatureActive = false; | 139 | this.isFeatureActive = false; |
139 | } | 140 | } |
@@ -162,7 +163,7 @@ export default class TodoStore extends FeatureStore { | |||
162 | }; | 163 | }; |
163 | 164 | ||
164 | @action _setTodosWebview = ({ webview }) => { | 165 | @action _setTodosWebview = ({ webview }) => { |
165 | debug('_setTodosWebview', webview); | 166 | console.log('_setTodosWebview', webview); |
166 | if (this.webview !== webview) { | 167 | if (this.webview !== webview) { |
167 | this.webview = webview; | 168 | this.webview = webview; |
168 | this.userAgentModel.setWebviewReference(webview); | 169 | this.userAgentModel.setWebviewReference(webview); |
@@ -170,14 +171,14 @@ export default class TodoStore extends FeatureStore { | |||
170 | }; | 171 | }; |
171 | 172 | ||
172 | @action _handleHostMessage = message => { | 173 | @action _handleHostMessage = message => { |
173 | debug('_handleHostMessage', message); | 174 | console.log('_handleHostMessage', message); |
174 | if (message.action === 'todos:create') { | 175 | if (message.action === 'todos:create') { |
175 | this.webview.send(IPC.TODOS_HOST_CHANNEL, message); | 176 | this.webview.send(IPC.TODOS_HOST_CHANNEL, message); |
176 | } | 177 | } |
177 | }; | 178 | }; |
178 | 179 | ||
179 | @action _handleClientMessage = ({ channel, message = {} }) => { | 180 | @action _handleClientMessage = ({ channel, message = {} }) => { |
180 | debug('_handleClientMessage', channel, message); | 181 | console.log('_handleClientMessage', channel, message); |
181 | switch (message.action) { | 182 | switch (message.action) { |
182 | case 'todos:initialized': | 183 | case 'todos:initialized': |
183 | this._onTodosClientInitialized(); | 184 | this._onTodosClientInitialized(); |
@@ -186,7 +187,7 @@ export default class TodoStore extends FeatureStore { | |||
186 | this._goToService(message.data); | 187 | this._goToService(message.data); |
187 | break; | 188 | break; |
188 | default: | 189 | default: |
189 | debug('Other message received', channel, message); | 190 | console.log('Other message received', channel, message); |
190 | if (this.stores.services.isTodosServiceAdded) { | 191 | if (this.stores.services.isTodosServiceAdded) { |
191 | this.actions.service.handleIPCMessage({ | 192 | this.actions.service.handleIPCMessage({ |
192 | serviceId: this.stores.services.isTodosServiceAdded.id, | 193 | serviceId: this.stores.services.isTodosServiceAdded.id, |
@@ -202,7 +203,7 @@ export default class TodoStore extends FeatureStore { | |||
202 | }; | 203 | }; |
203 | 204 | ||
204 | @action _toggleTodosFeatureVisibility = () => { | 205 | @action _toggleTodosFeatureVisibility = () => { |
205 | debug('_toggleTodosFeatureVisibility'); | 206 | console.log('_toggleTodosFeatureVisibility'); |
206 | 207 | ||
207 | this._updateSettings({ | 208 | this._updateSettings({ |
208 | isFeatureEnabledByUser: !this.settings.isFeatureEnabledByUser, | 209 | isFeatureEnabledByUser: !this.settings.isFeatureEnabledByUser, |
@@ -210,14 +211,14 @@ export default class TodoStore extends FeatureStore { | |||
210 | }; | 211 | }; |
211 | 212 | ||
212 | _openDevTools = () => { | 213 | _openDevTools = () => { |
213 | debug('_openDevTools'); | 214 | console.log('_openDevTools'); |
214 | 215 | ||
215 | const webview = document.querySelector('#todos-panel webview'); | 216 | const webview = document.querySelector('#todos-panel webview'); |
216 | if (webview) webview.openDevTools(); | 217 | if (webview) webview.openDevTools(); |
217 | }; | 218 | }; |
218 | 219 | ||
219 | _reload = () => { | 220 | _reload = () => { |
220 | debug('_reload'); | 221 | console.log('_reload'); |
221 | 222 | ||
222 | const webview = document.querySelector('#todos-panel webview'); | 223 | const webview = document.querySelector('#todos-panel webview'); |
223 | if (webview) webview.reload(); | 224 | if (webview) webview.reload(); |
@@ -285,7 +286,7 @@ export default class TodoStore extends FeatureStore { | |||
285 | const { pathname } = this.stores.router.location; | 286 | const { pathname } = this.stores.router.location; |
286 | 287 | ||
287 | if (pathname === TODOS_ROUTES.TARGET) { | 288 | if (pathname === TODOS_ROUTES.TARGET) { |
288 | debug('Router is on todos route, show todos panel'); | 289 | console.log('Router is on todos route, show todos panel'); |
289 | // todosStore.start(stores, actions); | 290 | // todosStore.start(stores, actions); |
290 | this.stores.router.push('/'); | 291 | this.stores.router.push('/'); |
291 | 292 | ||