You've already forked joplin
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user