mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
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
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user