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

All: Fixes #536: Allow changing sync target file path

This commit is contained in:
Laurent Cozic
2018-05-21 16:26:01 +01:00
parent ed70cf571c
commit 429f2d5aab
3 changed files with 19 additions and 15 deletions

View File

@ -1,4 +1,5 @@
const Setting = require('lib/models/Setting');
const { reg } = require('lib/registry.js');
const reduxSharedMiddleware = function(store, next, action) {
const newState = store.getState();
@ -6,6 +7,11 @@ const reduxSharedMiddleware = function(store, next, action) {
if (action.type == 'FOLDER_SET_COLLAPSED' || action.type == 'FOLDER_TOGGLE') {
Setting.setValue('collapsedFolderIds', newState.collapsedFolderIds);
}
if (action.type === 'SETTING_UPDATE_ONE' && !!action.key.match(/^sync\.\d+\.path$/)) {
reg.resetSyncTarget();
}
}
module.exports = reduxSharedMiddleware;