Skip to content

Commit

Permalink
Fix: Preload not being started on some cases (#2847)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanfbrito authored Feb 16, 2024
1 parent 7a4eaed commit 08fe390
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ const start = async () => {
});
}
};
};

console.log('[Rocket.Chat Desktop] Injected');
console.log('[Rocket.Chat Desktop] Injected');
};

start();
8 changes: 6 additions & 2 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ declare global {
}
}

console.log('[Rocket.Chat Desktop] Preload.ts');

contextBridge.exposeInMainWorld('JitsiMeetElectron', JitsiMeetElectron);
contextBridge.exposeInMainWorld('RocketChatDesktop', RocketChatDesktop);

const start = async (): Promise<void> => {
console.log('[Rocket.Chat Desktop] preload.ts start');
console.log('[Rocket.Chat Desktop] Preload.ts start fired');
const serverUrl = await invoke('server-view/get-url');

if (!serverUrl) {
console.log('[Rocket.Chat Desktop] preload.ts serverUrl is not defined');
console.log('[Rocket.Chat Desktop] serverUrl is not defined');
console.log('[Rocket.Chat Desktop] Preload start - retrying in 1 seconds');
setTimeout(start, 1000);
return;
}

Expand Down

0 comments on commit 08fe390

Please sign in to comment.