Use onClosed instead of onSuspend
Renames extension.windows.beforeUnload to onSuspend, to match the underlying chrome api call. onClosed fires when the frontend app window is closed, while onSuspend fires when the background page is closed or refreshed (which amounts to an app restart). Frontend views are initialized iff the inbox window is opened, and so should always be listening to onClosed in order to know when they are no longer needed. // FREEBIE
This commit is contained in:
@@ -63,8 +63,8 @@
|
||||
inboxFocused = true;
|
||||
});
|
||||
|
||||
// close the panel if background.html is refreshed
|
||||
extension.windows.beforeUnload(function() {
|
||||
// close the inbox if background.html is refreshed
|
||||
extension.windows.onSuspend(function() {
|
||||
// TODO: reattach after reload instead of closing.
|
||||
extension.windows.remove(inboxWindowId);
|
||||
});
|
||||
|
Reference in New Issue
Block a user