Skip to content

Commit abc1085

Browse files
committed
Improve comment.
1 parent 189b9d8 commit abc1085

File tree

1 file changed

+4
-5
lines changed
  • src/frontend/src/routes/(new-styling)/callback

1 file changed

+4
-5
lines changed

src/frontend/src/routes/(new-styling)/callback/utils.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ export const redirectInPopup = (url: string): Promise<string> => {
1515
);
1616

1717
return new Promise<string>((resolve, reject) => {
18-
// We need to throw an error when the window is closed, else the page and
19-
// thus the user will wait indefinitely for a result that never comes.
20-
//
21-
// We can't listen to close events since the window is likely cross-origin,
22-
// so instead we periodically check the closed attribute with an interval.
18+
// Monitor popup closure since cross-origin windows prevent close event
19+
// listening. We periodically check the closed attribute to detect when
20+
// the user closes the popup, allowing us to reject the promise instead
21+
// of waiting indefinitely for a result that will never arrive.
2322
const closeInterval = setInterval(() => {
2423
if (redirectWindow?.closed === true) {
2524
clearInterval(closeInterval);

0 commit comments

Comments
 (0)