Skip to content

Commit

Permalink
fix lazy loading itemgrid spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Dec 4, 2023
1 parent b0b6f20 commit edfb820
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion components/ItemGrid/ItemGrid.bs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,9 @@ end sub
'
'Load next set of items
sub loadMoreData()
startLoadingSpinner(false)
if m.Loading = true then return

startLoadingSpinner(false)
m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems
m.loadItemsTask.observeField("content", "ItemDataLoaded")
Expand Down
3 changes: 2 additions & 1 deletion components/ItemGrid/MovieLibraryView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,9 @@ end sub
'
'Load next set of items
sub loadMoreData()
startLoadingSpinner(false)
if m.Loading = true then return

startLoadingSpinner(false)
m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems
m.loadItemsTask.observeField("content", "ItemDataLoaded")
Expand Down
5 changes: 3 additions & 2 deletions components/ItemGrid/MusicLibraryView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ end sub
'Load initial set of Data
sub loadInitialItems()
m.loadItemsTask.control = "stop"
startLoadingSpinner()
startLoadingSpinner(false)

if LCase(m.top.parentItem.json.Type) = "collectionfolder"
m.top.HomeLibraryItem = m.top.parentItem.Id
Expand Down Expand Up @@ -550,8 +550,9 @@ end sub
'
'Load next set of items
sub loadMoreData()
startLoadingSpinner(false)
if m.Loading = true then return

startLoadingSpinner(false)
m.Loading = true
m.loadItemsTask.startIndex = m.loadedItems
m.loadItemsTask.observeField("content", "ItemDataLoaded")
Expand Down

0 comments on commit edfb820

Please sign in to comment.