X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fviews%2FGame.vue;h=709cccc44a6b474adcbaf8e17effa204a9be8271;hp=b52de8294fc60fc60757c7a4d485fb6a2f044afa;hb=23ecf00824691b5622b468e0409fc543c87d75dc;hpb=3b959cfaf3d3a28373d7ebb48d80087150a98006 diff --git a/client/src/views/Game.vue b/client/src/views/Game.vue index b52de829..709cccc4 100644 --- a/client/src/views/Game.vue +++ b/client/src/views/Game.vue @@ -70,6 +70,7 @@ import Chat from "@/components/Chat.vue"; 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"; @@ -206,16 +207,11 @@ export default { }, 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) {