Browse Source

fix(WS): sometimes vue was incorrectly detecting a route change

Signed-off-by: Jonathan <theflametrooper@gmail.com>
Jonathan 3 năm trước cách đây
mục cha
commit
0aabd2e75b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      frontend/src/main.js

+ 1 - 1
frontend/src/main.js

@@ -242,7 +242,7 @@ lofig.folder = "../config/default.json";
 			window.stationInterval = 0;
 		}
 
-		if (ws.socket) {
+		if (ws.socket && to.fullPath !== from.fullPath) {
 			ws.clearCallbacks();
 			ws.destroyListeners();
 		}