From f5b8927f5f98abeccf87e02039a4227e142a7213 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 4 Apr 2026 00:13:07 +0200 Subject: [PATCH] almost working filter --- webapp/components/Chat/Chat.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 846c37072..dbdb061c0 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -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 true→false. + // 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() {