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