You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-30 23:44:55 +02:00
Desktop: Resolves #5770: Performance improvement when switching note while plugins are running (#6409)
This commit is contained in:
committed by
GitHub
parent
1797e847aa
commit
5d9b43ee31
@ -33,14 +33,24 @@ export interface PluginStates {
|
||||
[key: string]: PluginState;
|
||||
}
|
||||
|
||||
export interface PluginHtmlContent {
|
||||
[viewId: string]: string;
|
||||
}
|
||||
|
||||
export interface PluginHtmlContents {
|
||||
[pluginId: string]: PluginHtmlContent;
|
||||
}
|
||||
|
||||
export interface State {
|
||||
plugins: PluginStates;
|
||||
pluginHtmlContents: PluginHtmlContents;
|
||||
}
|
||||
|
||||
export const stateRootKey = 'pluginService';
|
||||
|
||||
export const defaultState: State = {
|
||||
plugins: {},
|
||||
pluginHtmlContents: {},
|
||||
};
|
||||
|
||||
export const utils = {
|
||||
@ -139,7 +149,12 @@ const reducer = (draftRoot: Draft<any>, action: any) => {
|
||||
|
||||
case 'PLUGIN_VIEW_PROP_SET':
|
||||
|
||||
(draft.plugins[action.pluginId].views[action.id] as any)[action.name] = action.value;
|
||||
if (action.name !== 'html') {
|
||||
(draft.plugins[action.pluginId].views[action.id] as any)[action.name] = action.value;
|
||||
} else {
|
||||
draft.pluginHtmlContents[action.pluginId] ??= {};
|
||||
draft.pluginHtmlContents[action.pluginId][action.id] = action.value;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'PLUGIN_VIEW_PROP_PUSH':
|
||||
|
Reference in New Issue
Block a user