Skip to content
Snippets Groups Projects
Commit 3455cd5d authored by Arlo Breault's avatar Arlo Breault
Browse files

Ensure `snnowflake` was initialized in unload handlers

parent 99952ca7
No related branches found
No related tags found
No related merge requests found
......@@ -63,14 +63,18 @@ var snowflake, query, debug, silenceNotifications, log, dbg, init;
// Notification of closing tab with active proxy.
window.onbeforeunload = function() {
if (!silenceNotifications && Snowflake.MODE.WEBRTC_READY === snowflake.state) {
if (
!silenceNotifications &&
snowflake !== null &&
Snowflake.MODE.WEBRTC_READY === snowflake.state
) {
return Snowflake.MESSAGE.CONFIRMATION;
}
return null;
};
window.onunload = function() {
snowflake.disable();
if (snowflake !== null) { snowflake.disable(); }
return null;
};
......
......@@ -61,14 +61,18 @@ var debug, snowflake, config, broker, ui, log, dbg, init, update, silenceNotific
// Notification of closing tab with active proxy.
window.onbeforeunload = function() {
if (!silenceNotifications && Snowflake.MODE.WEBRTC_READY === snowflake.state) {
if (
!silenceNotifications &&
snowflake !== null &&
Snowflake.MODE.WEBRTC_READY === snowflake.state
) {
return Snowflake.MESSAGE.CONFIRMATION;
}
return null;
};
window.onunload = function() {
snowflake.disable();
if (snowflake !== null) { snowflake.disable(); }
return null;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment