Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ export async function createWorkspaceRuntime(deps: RuntimeDeps): Promise<Workspa
if (typeof window === 'undefined') {
return false;
}
if (!window.__LODY_ELECTRON__) {
if (!window.__LODY_ELECTRON__ && !window.__LODY_LOCAL_BRIDGE__) {
return false;
}
if (!getIpcServices()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export function createWorkspaceMachineRpcFacade(deps: WorkspaceMachineRpcFacadeD
await waitForMachineRoute(machineId);
return Boolean(
typeof window !== 'undefined' &&
window.__LODY_ELECTRON__ &&
(window.__LODY_ELECTRON__ || window.__LODY_LOCAL_BRIDGE__) &&
getLocalMachineRpcSender() &&
targetRouter.getPlaneForMachine(machineId) === 'local'
);
Expand Down Expand Up @@ -179,7 +179,9 @@ export function createWorkspaceMachineRpcFacade(deps: WorkspaceMachineRpcFacadeD
};
try {
const result = await (async () => {
const isElectron = typeof window !== 'undefined' && window.__LODY_ELECTRON__;
const isElectron =
typeof window !== 'undefined' &&
(window.__LODY_ELECTRON__ || window.__LODY_LOCAL_BRIDGE__);
if (isElectron) {
// A local Electron file preview must never fall through to the
// Streams RPC plane. Until the target router identifies the machine,
Expand Down Expand Up @@ -996,7 +998,7 @@ export function createWorkspaceMachineRpcFacade(deps: WorkspaceMachineRpcFacadeD
try {
await waitForMachineRoute(machineId);
if (
window.__LODY_ELECTRON__ &&
(window.__LODY_ELECTRON__ || window.__LODY_LOCAL_BRIDGE__) &&
getIpcServices() &&
targetRouter.getPlaneForMachine(machineId) === 'local'
) {
Expand Down Expand Up @@ -1052,7 +1054,7 @@ export function createWorkspaceMachineRpcFacade(deps: WorkspaceMachineRpcFacadeD
try {
await waitForMachineRoute(request.machineId);
if (
window.__LODY_ELECTRON__ &&
(window.__LODY_ELECTRON__ || window.__LODY_LOCAL_BRIDGE__) &&
getIpcServices() &&
targetRouter.getPlaneForMachine(request.machineId) === 'local'
) {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/window-globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ declare global {
__LODY_NATIVE__?: boolean;
__LODY_CORDOVA_READY__?: boolean;
__LODY_ELECTRON__?: true;
__LODY_LOCAL_BRIDGE__?: true;
__LODY_PLATFORM__?: {
os: string;
homeDir: string;
Expand Down