mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-27 12:41:39 +01:00
Fix bug
Signed-off-by: RMidhunSuresh <hi@midhun.dev>
This commit is contained in:
parent
60a92cf6b7
commit
f662a25c8b
@ -56,12 +56,13 @@ export class TimelineViewModel extends ViewModel {
|
|||||||
}
|
}
|
||||||
let hasSeenUpdate = false;
|
let hasSeenUpdate = false;
|
||||||
const checkForUpdate = (idx, tile) => {
|
const checkForUpdate = (idx, tile) => {
|
||||||
if (tile.shape !== "gap") {
|
if (tile.shape !== "gap" && !tile.isOwn) {
|
||||||
/*
|
/*
|
||||||
It's possible that this method executes before the GapTile has been rendered,
|
It's possible that this method executes before the GapTile has been rendered,
|
||||||
so don't count the GapTile as an update.
|
so don't count the GapTile as an update.
|
||||||
Usually happens when onScroll() is triggered by a non-timeline UI change,
|
Usually happens when onScroll() is triggered by a non-timeline UI change,
|
||||||
eg: SessionStatusView being rendered
|
eg: SessionStatusView being rendered
|
||||||
|
Also don't count updates from the user as these may update without triggering onScroll.
|
||||||
*/
|
*/
|
||||||
hasSeenUpdate = true;
|
hasSeenUpdate = true;
|
||||||
}
|
}
|
||||||
@ -70,8 +71,8 @@ export class TimelineViewModel extends ViewModel {
|
|||||||
onAdd: (idx, tile) => checkForUpdate(idx, tile),
|
onAdd: (idx, tile) => checkForUpdate(idx, tile),
|
||||||
onUpdate: (idx, tile) => checkForUpdate(idx, tile),
|
onUpdate: (idx, tile) => checkForUpdate(idx, tile),
|
||||||
onRemove: (idx, tile) => checkForUpdate(idx, tile),
|
onRemove: (idx, tile) => checkForUpdate(idx, tile),
|
||||||
onMove: (idx, tile) => checkForUpdate(idx, tile),
|
onMove: () => { /* shouldn't be called */ },
|
||||||
onReset: (idx, tile) => checkForUpdate(idx, tile)
|
onReset: () => { /* shouldn't be called */ }
|
||||||
};
|
};
|
||||||
this.tiles.subscribe(subscription);
|
this.tiles.subscribe(subscription);
|
||||||
let gapResult;
|
let gapResult;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user