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

Desktop: Added Goto Anything dialog and implemented basic plugin system

This commit is contained in:
Laurent Cozic
2019-04-01 19:43:13 +00:00
parent db04906416
commit 6b2910c3c7
14 changed files with 1018 additions and 90 deletions

View File

@ -48,6 +48,7 @@ const defaultState = {
toFetchCount: 0,
},
historyNotes: [],
plugins: {},
};
const stateUtils = {};
@ -691,6 +692,17 @@ const reducer = (state = defaultState, action) => {
newState.selectedNoteTags = action.items;
break;
case 'PLUGIN_DIALOG_SET':
if (!action.pluginName) throw new Error('action.pluginName not specified');
newState = Object.assign({}, state);
const newPlugins = Object.assign({}, newState.plugins);
const newPlugin = newState.plugins[action.pluginName] ? Object.assign({}, newState.plugins[action.pluginName]) : {};
if ('open' in action) newPlugin.dialogOpen = action.open;
newPlugins[action.pluginName] = newPlugin;
newState.plugins = newPlugins;
break;
}
} catch (error) {
error.message = 'In reducer: ' + error.message + ' Action: ' + JSON.stringify(action);