mirror of
https://github.com/vector-im/element-web.git
synced 2025-11-29 06:21:20 +01:00
Hide an event notification if it is redacted (#29605)
* Hide notifications from events that have been redacted. * lint * add a void * Remove ?.
This commit is contained in:
parent
829b588dbf
commit
d7730f417b
@ -16,6 +16,7 @@ import {
|
||||
type SSOAction,
|
||||
encodeUnpaddedBase64,
|
||||
type OidcRegistrationClientMetadata,
|
||||
MatrixEventEvent,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
@ -228,6 +229,16 @@ export default abstract class BasePlatform {
|
||||
window.focus();
|
||||
};
|
||||
|
||||
const closeHandler = (): void => notification.close();
|
||||
|
||||
// Clear a notification from a redacted event.
|
||||
if (ev) {
|
||||
ev.once(MatrixEventEvent.BeforeRedaction, closeHandler);
|
||||
notification.onclose = () => {
|
||||
ev.off(MatrixEventEvent.BeforeRedaction, closeHandler);
|
||||
};
|
||||
}
|
||||
|
||||
return notification;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user