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:
@@ -16,6 +16,7 @@ import {
|
|||||||
type SSOAction,
|
type SSOAction,
|
||||||
encodeUnpaddedBase64,
|
encodeUnpaddedBase64,
|
||||||
type OidcRegistrationClientMetadata,
|
type OidcRegistrationClientMetadata,
|
||||||
|
MatrixEventEvent,
|
||||||
} from "matrix-js-sdk/src/matrix";
|
} from "matrix-js-sdk/src/matrix";
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
|
|
||||||
@@ -228,6 +229,16 @@ export default abstract class BasePlatform {
|
|||||||
window.focus();
|
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;
|
return notification;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user