prevent toggling in vm while already busy

otherwise the check in SendQueue to prevent duplicates might fail
This commit is contained in:
Bruno Windels 2021-06-24 14:33:16 +02:00
parent 575f3fa966
commit 787308375c

View file

@ -157,8 +157,17 @@ class ReactionViewModel {
} }
} }
toggle(log = null) { async toggle(log = null) {
return this._parentTile.toggleReaction(this.key, log); if (this._isToggling) {
console.log("busy toggling reaction already");
return;
}
this._isToggling = true;
try {
await this._parentTile.toggleReaction(this.key, log);
} finally {
this._isToggling = false;
}
} }
} }