ソースを参照

Minor improvement of websocket handling

Alexey Edelev 5 年 前
コミット
9c5168a9ce
1 ファイル変更5 行追加2 行削除
  1. 5 2
      web/js/index.js

+ 5 - 2
web/js/index.js

@@ -520,9 +520,12 @@ function connectNotifier() {
     }
 }
 
-window.onbeforeunload = function() {
+$(window).on('beforeunload', function(){
     if (notifierSocket != null) {
-        notifierSocket.onclose = function () {}; // disable onclose handler first
         notifierSocket.close();
+        notifierSocket = null
     }
+});
+
+window.onbeforeunload = function() {
 };