Skip to content

Commit 32adae3

Browse files
samschSpaceK33z
authored andcommitted
Added beforeunload check to index.js (#544) (#841)
1 parent d69559a commit 32adae3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

client/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,15 @@ var socketUrl = url.format({
157157

158158
socket(socketUrl, onSocketMsg);
159159

160+
var isUnloading = false;
161+
self.addEventListener("beforeunload", function() {
162+
isUnloading = true;
163+
});
164+
160165
function reloadApp() {
166+
if(isUnloading) {
167+
return;
168+
}
161169
if(hot) {
162170
log("info", "[WDS] App hot update...");
163171
var hotEmitter = require("webpack/hot/emitter");

0 commit comments

Comments
 (0)