Skip to content

Commit c2fe9d4

Browse files
committed
revert openLinkChange
1 parent 99228e5 commit c2fe9d4

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

frontend/app/view/webview/webview.tsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,22 @@ import { getSimpleControlShiftAtom } from "@/app/store/keymodel";
77
import type { TabModel } from "@/app/store/tab-model";
88
import { makeORef } from "@/app/store/wos";
99
import { TabRpcClient } from "@/app/store/wshrpcutil";
10-
import { useWaveEnv } from "@/app/waveenv/waveenv";
1110
import {
1211
BlockHeaderSuggestionControl,
1312
SuggestionControlNoData,
1413
SuggestionControlNoResults,
1514
} from "@/app/suggestion/suggestion";
1615
import { MockBoundary } from "@/app/waveenv/mockboundary";
17-
import { globalStore } from "@/store/global";
16+
import { useWaveEnv } from "@/app/waveenv/waveenv";
17+
import { globalStore, openLink } from "@/store/global";
1818
import { adaptFromReactOrNativeKeyEvent, checkKeyPressed } from "@/util/keyutil";
1919
import { fireAndForget, useAtomValueSafe } from "@/util/util";
2020
import clsx from "clsx";
2121
import { WebviewTag } from "electron";
2222
import { Atom, PrimitiveAtom, atom, useAtomValue, useSetAtom } from "jotai";
2323
import { Fragment, createRef, memo, useCallback, useEffect, useRef, useState } from "react";
24-
import type { WebViewEnv } from "./webviewenv";
2524
import "./webview.scss";
25+
import type { WebViewEnv } from "./webviewenv";
2626

2727
// User agent strings for mobile emulation
2828
const USER_AGENT_IPHONE =
@@ -1010,14 +1010,7 @@ const WebView = memo(({ model, onFailLoad, blockRef, initialSrc }: WebViewProps)
10101010
const newWindowHandler = (e: any) => {
10111011
e.preventDefault();
10121012
const newUrl = e.detail.url;
1013-
fireAndForget(() =>
1014-
env.createBlock({
1015-
meta: {
1016-
view: "web",
1017-
url: newUrl,
1018-
},
1019-
})
1020-
);
1013+
fireAndForget(() => openLink(newUrl, true));
10211014
};
10221015
const startLoadingHandler = () => {
10231016
model.setRefreshIcon("xmark-large");
@@ -1120,4 +1113,4 @@ const WebView = memo(({ model, onFailLoad, blockRef, initialSrc }: WebViewProps)
11201113
);
11211114
});
11221115

1123-
export { getWebPreviewDisplayUrl, WebView, WebViewPreviewFallback };
1116+
export { WebView, WebViewPreviewFallback, getWebPreviewDisplayUrl };

0 commit comments

Comments
 (0)