1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Refactor to move state changes to browser process

This commit is contained in:
Laurent Cozic
2017-11-05 00:17:48 +00:00
parent cc277018b7
commit dbf51382c8
13 changed files with 241 additions and 92 deletions

View File

@ -192,6 +192,10 @@ class BaseApplication {
return o.join(', ');
}
hasGui() {
return false;
}
generalMiddleware() {
const middleware = store => next => async (action) => {
this.logger().debug('Reducer action', this.reducerActionToString(action));
@ -213,7 +217,7 @@ class BaseApplication {
await this.refreshNotes(BaseModel.TYPE_SEARCH, action.id);
}
if (this.gui() && action.type == 'SETTINGS_UPDATE_ONE' && action.key == 'sync.interval' || action.type == 'SETTINGS_UPDATE_ALL') {
if (this.hasGui() && action.type == 'SETTINGS_UPDATE_ONE' && action.key == 'sync.interval' || action.type == 'SETTINGS_UPDATE_ALL') {
reg.setupRecurrentSync();
}