Skip to content

Commit

Permalink
Subset paginated results only when needed
Browse files Browse the repository at this point in the history
This avoids a bug triggered when cached
results are out of sync.
  • Loading branch information
wkmor1 committed Nov 29, 2023
1 parent 3058947 commit 75631d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions R/finbif_records.R
Original file line number Diff line number Diff line change
Expand Up @@ -923,11 +923,15 @@ get_extra_pages <- function(fb_records_list) {

records_i <- value(res)

results <- c("content", "results")
if (length(records_i) > current_page_size) {

results_seq <- seq_len(current_page_size)
results <- c("content", "results")

records_i[[results]] <- records_i[[results]][results_seq]
results_seq <- seq_len(current_page_size)

records_i[[results]] <- records_i[[results]][results_seq]

}

records_i <- c(records_i, locale = fb_records_list[[i]][["locale"]])

Expand Down

0 comments on commit 75631d8

Please sign in to comment.