You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Convert shouldHideEvent to TS
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -14,10 +14,20 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import {MatrixEvent} from "matrix-js-sdk/src/models/event";
|
||||||
|
|
||||||
import SettingsStore from "./settings/SettingsStore";
|
import SettingsStore from "./settings/SettingsStore";
|
||||||
|
|
||||||
function memberEventDiff(ev) {
|
interface IDiff {
|
||||||
const diff = {
|
isMemberEvent: boolean;
|
||||||
|
isJoin?: boolean;
|
||||||
|
isPart?: boolean;
|
||||||
|
isDisplaynameChange?: boolean;
|
||||||
|
isAvatarChange?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
function memberEventDiff(ev: MatrixEvent): IDiff {
|
||||||
|
const diff: IDiff = {
|
||||||
isMemberEvent: ev.getType() === 'm.room.member',
|
isMemberEvent: ev.getType() === 'm.room.member',
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -37,7 +47,7 @@ function memberEventDiff(ev) {
|
|||||||
return diff;
|
return diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function shouldHideEvent(ev) {
|
export default function shouldHideEvent(ev: MatrixEvent): boolean {
|
||||||
// Wrap getValue() for readability. Calling the SettingsStore can be
|
// Wrap getValue() for readability. Calling the SettingsStore can be
|
||||||
// fairly resource heavy, so the checks below should avoid hitting it
|
// fairly resource heavy, so the checks below should avoid hitting it
|
||||||
// where possible.
|
// where possible.
|
||||||
Reference in New Issue
Block a user