Skip to content

Commit 915d180

Browse files
committed
Fix issue where new chrome windows would not appear in the Spaces window without refreshing it.
1 parent d0ffdf9 commit 915d180

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

js/background/background.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ export function initializeServiceWorker() {
141141
}
142142
});
143143

144-
// don't need this listener as the tabUpdated listener also fires when a new window is created
145-
// chrome.windows.onCreated.addListener(function (window) {
146-
147-
// if (checkInternalSpacesWindows(window.id, false)) return;
148-
// spacesService.handleWindowCreated(window);
149-
// });
144+
// Add listener for window creation to ensure new windows are detected
145+
chrome.windows.onCreated.addListener(function (window) {
146+
if (checkInternalSpacesWindows(window.id, false)) return;
147+
setTimeout(() => updateSpacesWindow('windows.onCreated'), 100);
148+
});
150149

151150
// add listeners for tab and window focus changes
152151
// when a tab or window is changed, close the move tab popup if it is open

0 commit comments

Comments
 (0)