Skip to content
Snippets Groups Projects
Unverified Commit bee810a7 authored by R Midhun Suresh's avatar R Midhun Suresh Committed by GitHub
Browse files

Merge pull request #36 from vector-im/hide-tiles

Hide annoying tiles from the timeline
parents f3b73b8b f16c7a1f
No related branches found
No related tags found
No related merge requests found
import { RoomViewModel, ViewModel, RoomStatus} from "hydrogen-view-sdk";
import { RoomViewModel, ViewModel, RoomStatus, tileClassForEntry} from "hydrogen-view-sdk";
function createCustomTileClassForEntry(ownUserId: string) {
return function customTileClassForEntry(entry) {
if (entry.content?.membership === "join" && entry.sender !== ownUserId ||
entry.eventType !== "m.room.member") {
return tileClassForEntry(entry);
}
return undefined;
}
}
export class ChatterboxViewModel extends ViewModel {
private _roomViewModel?: typeof RoomViewModel;
......@@ -30,6 +40,7 @@ export class ChatterboxViewModel extends ViewModel {
platform: this.platform,
urlCreator: this.urlCreator,
navigation: this.navigation,
tileClassForEntry: createCustomTileClassForEntry(this._session.userId),
}));
await this._roomViewModel.load();
this.emitChange("roomViewModel");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment