forked from mystiq/hydrogen-web
prevent toggling in vm while already busy
otherwise the check in SendQueue to prevent duplicates might fail
This commit is contained in:
parent
575f3fa966
commit
787308375c
1 changed files with 11 additions and 2 deletions
|
@ -157,8 +157,17 @@ class ReactionViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
toggle(log = null) {
|
||||
return this._parentTile.toggleReaction(this.key, log);
|
||||
async toggle(log = null) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue