Skip to content

Commit

Permalink
Items list: Add note that states are not updated in real-time & Code …
Browse files Browse the repository at this point in the history
…improvement

Signed-off-by: Florian Hotze <dev@florianhotze.com>
  • Loading branch information
florian-h05 committed Oct 24, 2024
1 parent 0a58424 commit 01ab5c1
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@
<f7-list-item title="Nothing found" />
</f7-list>

<f7-block class="block-narrow">
<f7-block class="block-narrow margin-top-half">
<f7-col>
<div>
<f7-block-footer class="no-margin-top" style="padding-left: 16px; padding-right: 16px">
Note: Item states are not updated in real-time. Click the refresh button to update.
</f7-block-footer>
</div>
</f7-col>

<!-- skeleton for not ready -->
<f7-col v-show="!ready">
<f7-block-title>&nbsp;Loading...</f7-block-title>
Expand Down Expand Up @@ -135,6 +143,7 @@ export default {
data () {
return {
ready: false,
loading: false,
items: [], // [{ label: 'Staircase', name: 'Staircase'}],
vlData: {
items: []
Expand All @@ -159,6 +168,9 @@ export default {
this.$f7.data.lastItemSearchQuery = this.$refs.searchbar?.f7Searchbar.query
},
load () {
if (this.loading) return
this.loading = true
if (this.ready) this.$f7.data.lastItemSearchQuery = this.$refs.searchbar?.f7Searchbar.query
this.ready = false
Expand All @@ -178,6 +190,7 @@ export default {
this.$refs.searchbar?.f7Searchbar.search(this.$f7.data.lastItemSearchQuery || '')
})
this.loading = false
this.ready = true
})
},
Expand Down

0 comments on commit 01ab5c1

Please sign in to comment.