pass in tilesCreator everywhere, although not needed right now

This commit is contained in:
Bruno Windels 2022-01-14 16:06:29 +01:00
parent 1ea4a347e2
commit ad335d5088
5 changed files with 7 additions and 7 deletions

View file

@ -225,7 +225,7 @@ export function tests() {
return new BaseMessageTile({entry, roomVM: {room}, timeline, platform: {logger}}); return new BaseMessageTile({entry, roomVM: {room}, timeline, platform: {logger}});
} }
return null; return null;
}, (tile, params, entry) => tile?.updateEntry(entry, params)); }, (tile, params, entry) => tile?.updateEntry(entry, params, null));
return tiles; return tiles;
} }

View file

@ -128,7 +128,7 @@ export class BaseMessageTile extends SimpleTile {
this._replyTile?.emitChange(); this._replyTile?.emitChange();
} }
} }
const action = super.updateEntry(entry, param); const action = super.updateEntry(entry, param, tilesCreator);
if (action.shouldUpdate) { if (action.shouldUpdate) {
this._updateReactions(); this._updateReactions();
} }

View file

@ -18,8 +18,8 @@ import {BaseTextTile} from "./BaseTextTile.js";
import {UpdateAction} from "../UpdateAction.js"; import {UpdateAction} from "../UpdateAction.js";
export class EncryptedEventTile extends BaseTextTile { export class EncryptedEventTile extends BaseTextTile {
updateEntry(entry, params) { updateEntry(entry, params, tilesCreator) {
const parentResult = super.updateEntry(entry, params); const parentResult = super.updateEntry(entry, params, tilesCreator);
// event got decrypted, recreate the tile and replace this one with it // event got decrypted, recreate the tile and replace this one with it
if (entry.eventType !== "m.room.encrypted") { if (entry.eventType !== "m.room.encrypted") {
// the "shape" parameter trigger tile recreation in TimelineView // the "shape" parameter trigger tile recreation in TimelineView

View file

@ -81,8 +81,8 @@ export class GapTile extends SimpleTile {
this._siblingChanged = true; this._siblingChanged = true;
} }
updateEntry(entry, params) { updateEntry(entry, params, tilesCreator) {
super.updateEntry(entry, params); super.updateEntry(entry, params, tilesCreator);
if (!entry.isGap) { if (!entry.isGap) {
return UpdateAction.Remove(); return UpdateAction.Remove();
} else { } else {

View file

@ -92,7 +92,7 @@ export class SimpleTile extends ViewModel {
} }
// update received for already included (falls within sort keys) entry // update received for already included (falls within sort keys) entry
updateEntry(entry, param) { updateEntry(entry, param, tilesCreator) {
const renderedAsRedacted = this.shape === "redacted"; const renderedAsRedacted = this.shape === "redacted";
if (!entry.isGap && entry.isRedacted !== renderedAsRedacted) { if (!entry.isGap && entry.isRedacted !== renderedAsRedacted) {
// recreate the tile if the entry becomes redacted // recreate the tile if the entry becomes redacted