Skip to content

Commit

Permalink
update logic load proposal and fix loading on transaction page
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeBoy committed May 10, 2024
1 parent e507ac0 commit 14b7a26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 0 additions & 4 deletions libwallet/internal/politeia/politeia_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,6 @@ func (p *Politeia) ProposalVoteDetailsRaw(ctx context.Context, wallet *wallet.Wa
hashes = append(hashes, hash)
}

if err != nil {
return nil, err
}

ticketHashes, addresses, err := wallet.CommittedTickets(ctx, hashes)
if err != nil {
return nil, err
Expand Down
6 changes: 4 additions & 2 deletions ui/page/components/items_scroll.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (s *Scroll[T]) FetchScrollData(isScrollUp bool, window app.WindowNavigator,
s.cacheData = nil
}
s.mu.Unlock()
if s.data == nil {
if s.data == nil || len(s.data.items) == 0 {
s.fetchScrollData(isScrollUp, window)
}
}
Expand All @@ -118,7 +118,6 @@ func (s *Scroll[T]) fetchScrollData(isScrollUp bool, window app.WindowNavigator)
if s.isLoadingItems || s.queryFunc == nil {
return
}

s.mu.Lock()
tempSize := s.pageSize
// Scroll up and down without load more
Expand Down Expand Up @@ -177,6 +176,9 @@ func (s *Scroll[T]) fetchScrollData(isScrollUp bool, window app.WindowNavigator)
items, _, _, err := s.queryFunc(s.offset, tempSize)
if len(items) <= 0 {
s.isLoadingItems = false
if s.itemsCount == -1 {
s.itemsCount = 0
}
return
}

Expand Down

0 comments on commit 14b7a26

Please sign in to comment.