mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
pass in tilesCreator everywhere, although not needed right now
This commit is contained in:
parent
1ea4a347e2
commit
ad335d5088
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user