Skip to content

Commit

Permalink
fix: return previous saved records in case of empty response from apis (
Browse files Browse the repository at this point in the history
  • Loading branch information
leopuleo committed Sep 15, 2023
1 parent 0fe93dc commit 779e53c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions packages/app-aco/src/contexts/records.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,6 @@ export const SearchRecordsProvider: React.VFC<Props> = ({ children }) => {
}

setRecords(prev => {
// If no data received, return the previous state
if (!data.length) {
return prev;
}

// If there's no cursor, it means we're receiving a new list of records from scratch.
if (!after) {
return data;
Expand Down

0 comments on commit 779e53c

Please sign in to comment.