Skip to content

Commit 00d5a6a

Browse files
authored
fix(desktop): temp solution to the inability to screen share and preview files (#1295)
1 parent a4e4be1 commit 00d5a6a

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

desktop/renderer-app/src/utils/portal-window-manager.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,21 @@ class PortalWindowManager {
7777

7878
portalWindow.document.body.appendChild(containerElement);
7979

80+
/**
81+
* TODO: electron bug @BlackHole1
82+
*/
8083
// the main process injects browserWindowID by calling executeJavaScript asynchronously.
8184
// so when a new window is opened, the window may not exist yet browserWindowID, and we need to wait awhile
8285
// it will only take about 10ms to get the value. Even at 500ms, the user experience is not bad.
8386
// the wait here does not block the creation of the window, only the subsequent rendering
84-
await new Promise<void>(r => {
85-
const id = setInterval(() => {
86-
if (portalWindow.browserWindowID) {
87-
clearInterval(id);
88-
r();
89-
}
90-
}, 10);
91-
});
87+
// await new Promise<void>(r => {
88+
// const id = setInterval(() => {
89+
// if (portalWindow.browserWindowID) {
90+
// clearInterval(id);
91+
// r();
92+
// }
93+
// }, 10);
94+
// });
9295

9396
return portalWindow;
9497
}

0 commit comments

Comments
 (0)