Skip to content

Commit 2eae468

Browse files
committed
assets: live-reload
1 parent fb03441 commit 2eae468

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/assets/live-realod.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,16 @@
2323
window.location.reload();
2424
}
2525
};
26-
})
26+
27+
ws.onclose = () => {
28+
if (!closing) {
29+
setTimeout(() => connect(true), 200);
30+
}
31+
};
32+
33+
ws.onmessage = msg => {
34+
if (msg.data == "reload") {
35+
window.location.reload();
36+
}
37+
};
38+
})();

0 commit comments

Comments
 (0)