Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(desktop): temp solution to the inability to screen share and preview files #1295

Merged
merged 1 commit into from
Jan 13, 2022
Merged
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
19 changes: 11 additions & 8 deletions desktop/renderer-app/src/utils/portal-window-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,21 @@ class PortalWindowManager {

portalWindow.document.body.appendChild(containerElement);

/**
* TODO: electron bug @BlackHole1
*/
// the main process injects browserWindowID by calling executeJavaScript asynchronously.
// so when a new window is opened, the window may not exist yet browserWindowID, and we need to wait awhile
// it will only take about 10ms to get the value. Even at 500ms, the user experience is not bad.
// the wait here does not block the creation of the window, only the subsequent rendering
await new Promise<void>(r => {
const id = setInterval(() => {
if (portalWindow.browserWindowID) {
clearInterval(id);
r();
}
}, 10);
});
// await new Promise<void>(r => {
// const id = setInterval(() => {
// if (portalWindow.browserWindowID) {
// clearInterval(id);
// r();
// }
// }, 10);
// });

return portalWindow;
}
Expand Down