mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Added feature flag for opening vscode in a new tab (#8917)
This commit is contained in:
parent
dee89462c2
commit
b76553136e
@ -5,6 +5,7 @@ import { I18nKey } from "#/i18n/declaration";
|
||||
import { RootState } from "#/store";
|
||||
import { RUNTIME_INACTIVE_STATES } from "#/types/agent-state";
|
||||
import { useVSCodeUrl } from "#/hooks/query/use-vscode-url";
|
||||
import { VSCODE_IN_NEW_TAB } from "#/utils/feature-flags";
|
||||
|
||||
function VSCodeTab() {
|
||||
const { t } = useTranslation();
|
||||
@ -22,7 +23,9 @@ function VSCodeTab() {
|
||||
const currentProtocol = window.location.protocol;
|
||||
|
||||
// Check if the iframe URL has a different protocol than the current page
|
||||
setIsCrossProtocol(iframeProtocol !== currentProtocol);
|
||||
setIsCrossProtocol(
|
||||
VSCODE_IN_NEW_TAB() || iframeProtocol !== currentProtocol,
|
||||
);
|
||||
} catch (e) {
|
||||
// Silently handle URL parsing errors
|
||||
setIframeError(t("VSCODE$URL_PARSE_ERROR"));
|
||||
|
||||
@ -14,5 +14,6 @@ export function loadFeatureFlag(
|
||||
|
||||
export const BILLING_SETTINGS = () => loadFeatureFlag("BILLING_SETTINGS");
|
||||
export const HIDE_LLM_SETTINGS = () => loadFeatureFlag("HIDE_LLM_SETTINGS");
|
||||
export const VSCODE_IN_NEW_TAB = () => loadFeatureFlag("VSCODE_IN_NEW_TAB");
|
||||
export const ENABLE_TRAJECTORY_REPLAY = () =>
|
||||
loadFeatureFlag("TRAJECTORY_REPLAY");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user