File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 128
128
</div >
129
129
<transition name =" vac-fade-message" >
130
130
<infinite-loading
131
- v-if =" rooms.length"
131
+ v-if =" !loadingRooms && rooms.length"
132
132
spinner =" spiral"
133
133
@infinite =" loadMoreRooms"
134
134
>
@@ -179,23 +179,22 @@ export default {
179
179
},
180
180
181
181
watch: {
182
- rooms (val ) {
183
- this .filteredRooms = val
182
+ rooms (newVal , oldVal ) {
183
+ this .filteredRooms = newVal
184
184
185
- if (this .infiniteState ) {
185
+ if (
186
+ this .infiniteState &&
187
+ (newVal .length !== oldVal .length || this .roomsLoaded )
188
+ ) {
186
189
this .infiniteState .loaded ()
187
- setTimeout (() => ( this .loadingMoreRooms = false ), 0 )
190
+ this .loadingMoreRooms = false
188
191
}
189
192
},
190
193
191
194
loadingRooms (val ) {
192
195
if (val) this .infiniteState = null
193
196
},
194
197
195
- roomsLoaded () {
196
- if (this .infiniteState ) this .infiniteState .complete ()
197
- },
198
-
199
198
loadingMoreRooms (val ) {
200
199
this .$emit (' loading-more-rooms' , val)
201
200
},
@@ -225,6 +224,7 @@ export default {
225
224
if (this .loadingMoreRooms ) return
226
225
227
226
if (this .roomsLoaded ) {
227
+ this .loadingMoreRooms = false
228
228
return infiniteState .complete ()
229
229
}
230
230
You can’t perform that action at this time.
0 commit comments