1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Chore: Apply changes from mobile plugins to lib/ and app-desktop/ (#10079)

This commit is contained in:
Henry Heino
2024-03-09 03:03:57 -08:00
committed by GitHub
parent 91004f5714
commit 25cd5affca
37 changed files with 418 additions and 205 deletions

View File

@ -1,13 +1,18 @@
import { Draft } from 'immer';
import { ContainerType } from './WebviewController';
import { ButtonSpec } from './api/types';
export interface ViewInfo {
view: any;
plugin: any;
}
interface PluginViewState {
export interface PluginViewState {
id: string;
type: string;
opened: boolean;
buttons: ButtonSpec[];
fitToContent?: boolean;
scripts?: string[];
html?: string;
commandName?: string;
location?: string;
containerType: ContainerType;
}
interface PluginViewStates {
@ -29,6 +34,11 @@ interface PluginState {
views: PluginViewStates;
}
export interface ViewInfo {
view: PluginViewState;
plugin: PluginState;
}
export interface PluginStates {
[key: string]: PluginState;
}
@ -181,6 +191,10 @@ const reducer = (draftRoot: Draft<any>, action: any) => {
break;
}
case 'PLUGIN_UNLOAD':
delete draft.plugins[action.pluginId];
break;
}
} catch (error) {
error.message = `In plugin reducer: ${error.message} Action: ${JSON.stringify(action)}`;