diff --git a/apps/client/src/widgets/type_widgets/WebView.tsx b/apps/client/src/widgets/type_widgets/WebView.tsx index dd3ab43c9e..b624a62800 100644 --- a/apps/client/src/widgets/type_widgets/WebView.tsx +++ b/apps/client/src/widgets/type_widgets/WebView.tsx @@ -1,7 +1,8 @@ import "./WebView.css"; -import { useCallback, useState } from "preact/hooks"; +import { useCallback, useEffect, useRef, useState } from "preact/hooks"; +import appContext from "../../components/app_context"; import FNote from "../../entities/fnote"; import attributes from "../../services/attributes"; import { t } from "../../services/i18n"; @@ -17,7 +18,7 @@ import { TypeWidgetProps } from "./type_widget"; const isElectron = utils.isElectron(); const HELP_PAGE = "1vHRoWCEjj0L"; -export default function WebView({ note }: TypeWidgetProps) { +export default function WebView({ note, ntxId }: TypeWidgetProps) { const [ webViewSrc ] = useNoteLabel(note, "webViewSrc"); const [ disabledWebViewSrc ] = useNoteLabel(note, "disabled:webViewSrc"); @@ -29,15 +30,36 @@ export default function WebView({ note }: TypeWidgetProps) { return ; } - return ; + return isElectron + ? + : ; } -function WebViewContent({ src }: { src: string }) { - if (!isElectron) { - return