Reset spoiler expand state when a message is edited
This commit is contained in:
parent
959b8ef457
commit
01231eb1c6
1 changed files with 6 additions and 6 deletions
|
@ -5046,16 +5046,16 @@ export function reducer(
|
|||
return state;
|
||||
}
|
||||
|
||||
const toIncrement =
|
||||
data.reactions?.length ||
|
||||
existingMessage.editHistory?.length !== data.editHistory?.length
|
||||
? 1
|
||||
: 0;
|
||||
const hasNewEdit =
|
||||
existingMessage.editHistory?.length !== data.editHistory?.length ? 1 : 0;
|
||||
const toIncrement = data.reactions?.length || hasNewEdit;
|
||||
|
||||
const updatedMessage = {
|
||||
...data,
|
||||
displayLimit: existingMessage.displayLimit,
|
||||
isSpoilerExpanded: existingMessage.isSpoilerExpanded,
|
||||
isSpoilerExpanded: hasNewEdit
|
||||
? undefined
|
||||
: existingMessage.isSpoilerExpanded,
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue