You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Android: Plugins: Fix inspecting note editor WebViews (#13272)
This commit is contained in:
@@ -137,7 +137,11 @@ const useTempDirPath = () => {
|
||||
return tempDirPath;
|
||||
};
|
||||
|
||||
const useWebViewSetup = (props: Props): SetUpResult<RendererControl> => {
|
||||
type Result = SetUpResult<RendererControl> & {
|
||||
hasPluginScripts: boolean;
|
||||
};
|
||||
|
||||
const useWebViewSetup = (props: Props): Result => {
|
||||
const tempDirPath = useTempDirPath();
|
||||
const { css, injectedJs } = useSource(tempDirPath);
|
||||
const { editPopupCss, createEditPopupSyntax, destroyEditPopupSyntax } = useEditPopup(props.themeId);
|
||||
@@ -269,6 +273,7 @@ const useWebViewSetup = (props: Props): SetUpResult<RendererControl> => {
|
||||
};
|
||||
}, [createEditPopupSyntax, destroyEditPopupSyntax, messenger]);
|
||||
|
||||
const hasPluginScripts = contentScripts.length > 0;
|
||||
return useMemo(() => {
|
||||
return {
|
||||
api: rendererControl,
|
||||
@@ -280,8 +285,9 @@ const useWebViewSetup = (props: Props): SetUpResult<RendererControl> => {
|
||||
onLoadEnd: messenger.onWebViewLoaded,
|
||||
onMessage: messenger.onWebViewMessage,
|
||||
},
|
||||
hasPluginScripts,
|
||||
};
|
||||
}, [css, injectedJs, messenger, editPopupCss, rendererControl]);
|
||||
}, [css, injectedJs, messenger, editPopupCss, rendererControl, hasPluginScripts]);
|
||||
};
|
||||
|
||||
export default useWebViewSetup;
|
||||
|
||||
Reference in New Issue
Block a user