Skip to content

Commit

Permalink
use fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
esimkowitz committed Oct 18, 2024
1 parent 11ee4ae commit 538956e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frontend/app/view/webview/webview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { fireAndForget } from "@/util/util";
import clsx from "clsx";
import { WebviewTag } from "electron";
import { Atom, PrimitiveAtom, atom, useAtomValue } from "jotai";
import React, { memo, useEffect, useState } from "react";
import { Fragment, createRef, memo, useEffect, useRef, useState } from "react";
import "./webview.less";

let webviewPreloadUrl = null;
Expand Down Expand Up @@ -76,8 +76,8 @@ export class WebViewModel implements ViewModel {
this.refreshIcon = atom("rotate-right");
this.viewIcon = atom("globe");
this.viewName = atom("Web");
this.urlInputRef = React.createRef<HTMLInputElement>();
this.webviewRef = React.createRef<WebviewTag>();
this.urlInputRef = createRef<HTMLInputElement>();
this.webviewRef = createRef<WebviewTag>();

this.mediaPlaying = atom(false);
this.mediaMuted = atom(false);
Expand Down Expand Up @@ -485,7 +485,7 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => {
const defaultSearch = useAtomValue(defaultSearchAtom);
let metaUrl = blockData?.meta?.url || defaultUrl;
metaUrl = model.ensureUrlScheme(metaUrl, defaultSearch);
const metaUrlRef = React.useRef(metaUrl);
const metaUrlRef = useRef(metaUrl);

// The initial value of the block metadata URL when the component first renders. Used to set the starting src value for the webview.
const [metaUrlInitial] = useState(metaUrl);
Expand Down Expand Up @@ -624,7 +624,7 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => {
}, []);

return (
<>
<Fragment>
<webview
id="webview"
className="webview"
Expand All @@ -641,7 +641,7 @@ const WebView = memo(({ model, onFailLoad }: WebViewProps) => {
<div>{errorText}</div>
</div>
)}
</>
</Fragment>
);
});

Expand Down

0 comments on commit 538956e

Please sign in to comment.