manage voicerecording state when deleting or sending a voice message (#7896)
* manage voicerecording state when deleting or sending a voice message Signed-off-by: Kerry Archibald <kerrya@element.io> * comment Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
5167b30ee6
commit
130bd6aa63
2 changed files with 108 additions and 1 deletions
|
@ -82,7 +82,15 @@ export class VoiceRecordingStore extends AsyncStoreWithClient<IState> {
|
|||
if (this.state[roomId]) {
|
||||
this.state[roomId].destroy(); // stops internally
|
||||
}
|
||||
return this.updateState(Object.fromEntries(Object.entries(this.state).filter(e => e[0] !== roomId)));
|
||||
|
||||
const {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
[roomId]: _toDelete,
|
||||
...newState
|
||||
} = this.state;
|
||||
// unexpectedly AsyncStore.updateState merges state
|
||||
// AsyncStore.reset actually just *sets*
|
||||
return this.reset(newState);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue