almost working filter

This commit is contained in:
Ulf Gebhardt 2026-04-04 00:13:07 +02:00
parent fd7da77db2
commit f5b8927f5f
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -183,6 +183,7 @@ export default {
roomCursor: null,
roomPageSize: 10,
roomSearch: '',
roomObserverDirty: false,
selectedRoom: null,
activeRoomId: null,
loadingRooms: true,
@ -566,6 +567,7 @@ export default {
const value = typeof event === 'string' ? event : event?.value
this.roomSearch = value || ''
this.roomCursor = null
if (this.roomsLoaded) this.roomObserverDirty = true
this.roomsLoaded = false
this.roomSearchGeneration = (this.roomSearchGeneration || 0) + 1
const generation = this.roomSearchGeneration
@ -590,6 +592,17 @@ export default {
this.rooms = []
this.$toast.error(error.message)
}
// Re-init IntersectionObserver after it was disabled by roomsLoaded=true.
// The library only calls initIntersectionObserver on loadingRooms truefalse.
// We can only toggle loadingRooms when the search is empty (otherwise the
// search input gets destroyed). The dirty flag persists across searches until cleared.
if (this.roomObserverDirty && !this.roomsLoaded && !this.roomSearch) {
this.roomObserverDirty = false
this.loadingRooms = true
this.$nextTick(() => {
this.loadingRooms = false
})
}
},
fetchMoreRooms() {