import { store } from "@/store";
import { GameStorage } from "@/utils/gameStorage";
import { ppt } from "@/utils/datetime";
+import { ajax } from "@/utils/ajax";
import { extractTime } from "@/utils/timeControl";
import { getRandString } from "@/utils/alea";
import { processModalClick } from "@/utils/modalClick";
},
clearChat: function() {
// Nothing more to do if game is live (chats not recorded)
- if (this.game.mycolor && this.game.type == "corr") {
- ajax(
- "/chats",
- "DELETE",
- {gid: this.game.id},
- () => {
- // TODO: this.game.pastChats = [] could be enough here?
- this.$set(this.game, "pastChats", []);
- }
- );
+ if (this.game.type == "corr") {
+ if (this.game.mycolor)
+ ajax("/chats", "DELETE", {gid: this.game.id});
+ // TODO: this.game.chats = [] could be enough here?
+ this.$set(this.game, "chats", []);
}
},
socketMessageListener: function(msg) {
break;
case "killed":
// I logged in elsewhere:
- alert(this.st.tr["New connexion detected: tab now offline"]);
// TODO: this fails. See https://github.com/websockets/ws/issues/489
//this.conn.removeEventListener("message", this.socketMessageListener);
//this.conn.removeEventListener("close", this.socketCloseListener);
//this.conn.close();
this.conn = null;
+ alert(this.st.tr["New connexion detected: tab now offline"]);
break;
case "askidentity": {
// Request for identification (TODO: anonymous shouldn't need to reply)