mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
update web view url if meta url changes
This commit is contained in:
parent
a23b5ca0e0
commit
817afd6138
@ -301,6 +301,15 @@ interface WebViewProps {
|
||||
|
||||
const WebView = memo(({ parentRef, model }: WebViewProps) => {
|
||||
const url = model.getUrl();
|
||||
const blockData = jotai.useAtomValue(model.blockAtom);
|
||||
const metaUrl = blockData?.meta?.url;
|
||||
const metaUrlRef = React.useRef(metaUrl);
|
||||
useEffect(() => {
|
||||
if (metaUrlRef.current != metaUrl) {
|
||||
metaUrlRef.current = metaUrl;
|
||||
model.navigateTo(metaUrl);
|
||||
}
|
||||
}, [metaUrl]);
|
||||
|
||||
useEffect(() => {
|
||||
const webview = model.webviewRef.current;
|
||||
|
Loading…
Reference in New Issue
Block a user