Skip to content

Commit 20342ab

Browse files
committed
fix kicked message
1 parent 18336a2 commit 20342ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client/scripts/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,15 @@ class Game {
100100
this.chat.log(msg);
101101
});
102102
this.socket.on("kicked", (reason) => {
103+
document.exitPointerLock();
103104
console.log(reason);
105+
reason = JSON.parse(reason);
104106
swal({
105107
title: "You've been kicked!",
106-
text: JSON.parse(reason).extra[0].text,
108+
text:
109+
reason.extra !== undefined
110+
? reason.extra[0].text
111+
: reason.text,
107112
icon: "error",
108113
button: "Rejoin",
109114
}).then(function () {

0 commit comments

Comments
 (0)