1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Fixes

This commit is contained in:
Laurent Cozic 2022-11-15 08:51:40 +00:00
parent fce571f38c
commit a40a5ef3bf
3 changed files with 8 additions and 6 deletions

View File

@ -220,7 +220,7 @@ function Editor(props: EditorProps, ref: any) {
cm.off('refresh', editor_resize);
cm.off('update', editor_update);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
editorParent.current.removeChild(cm.getWrapperElement());
if (editorParent.current) editorParent.current.removeChild(cm.getWrapperElement());
setEditor(null);
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied

View File

@ -41,10 +41,12 @@ export default function useViewIsReady(viewRef: any) {
viewRef.current.contentWindow.addEventListener('message', onMessage);
return () => {
viewRef.current.removeEventListener('dom-ready', onIFrameReady);
viewRef.current.removeEventListener('load', onIFrameReady);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
viewRef.current.contentWindow.removeEventListener('message', onMessage);
if (viewRef.current) {
viewRef.current.removeEventListener('dom-ready', onIFrameReady);
viewRef.current.removeEventListener('load', onIFrameReady);
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
viewRef.current.contentWindow.removeEventListener('message', onMessage);
}
};
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
}, []);

View File

@ -114,7 +114,7 @@ const execApi = async (method: HttpMethod, path: string, body: Record<string, st
throw error;
}
return response.json();
return response.json() as any;
};
const getForumTopPostByExternalId = async (externalId: string): Promise<ForumTopPost> => {