fix(ui): complete VS Code bootstrap detection for directory startup (#2359)
This commit is contained in:
@@ -5,6 +5,7 @@ import type { DraftStarterRef } from '@/lib/draftStarters';
|
||||
import type { MobileKeyboardMode } from '@/lib/mobileKeyboardMode';
|
||||
import { getRuntimeApiBaseUrl, getRuntimeKey } from '@/lib/runtime-switch';
|
||||
import { getRegisteredRuntimeAPIs } from '@/contexts/runtimeAPIRegistry';
|
||||
import { isVSCodeBootstrapPresent } from '@/lib/vscodeBootstrap';
|
||||
|
||||
type ManagedRemoteTunnelPreset = {
|
||||
id: string;
|
||||
@@ -573,6 +574,12 @@ export const startDesktopWindowDrag = async (): Promise<boolean> => {
|
||||
};
|
||||
|
||||
export const isVSCodeRuntime = (): boolean => {
|
||||
// Prefer extension-host bootstrap config: it is injected in webview HTML
|
||||
// before any store module evaluates, so startup does not depend on
|
||||
// RuntimeAPIs registration order (see #2359).
|
||||
if (isVSCodeBootstrapPresent()) {
|
||||
return true;
|
||||
}
|
||||
const apis = getRegisteredRuntimeAPIs();
|
||||
return apis?.runtime?.isVSCode === true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user