Skip to content

Commit 2b5dbf7

Browse files
authored
fix(recently-deleted): keep previous-criteria rows inert while the new list loads (#8964)
1 parent 824b5d3 commit 2b5dbf7

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎apps/sim/app/workspace/[workspaceId]/settings/components/recently-deleted/recently-deleted.tsx‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,19 @@ export function RecentlyDeleted() {
234234
const restoreWorkspaceFileFolder = useRestoreWorkspaceFileFolder()
235235
const restoreChat = useRestoreMothershipChat(workspaceId)
236236

237-
const { hasNextPage, isFetchingNextPage, isFetchNextPageError, fetchNextPage, isLoading, error } =
238-
deletedQuery
237+
const {
238+
hasNextPage,
239+
isFetchingNextPage,
240+
isFetchNextPageError,
241+
fetchNextPage,
242+
isLoading,
243+
isPlaceholderData,
244+
error,
245+
} = deletedQuery
239246

240247
const loadMoreRef = useLoadMoreSentinel({
241248
onLoadMore: fetchNextPage,
242-
enabled: hasNextPage && !isFetchingNextPage && !isFetchNextPageError,
249+
enabled: hasNextPage && !isFetchingNextPage && !isFetchNextPageError && !isPlaceholderData,
243250
})
244251

245252
const filtered = useMemo(() => {
@@ -436,7 +443,11 @@ export function RecentlyDeleted() {
436443
View
437444
</Chip>
438445
) : (
439-
<Chip variant='primary' onClick={() => void handleRestore(resource)}>
446+
<Chip
447+
variant='primary'
448+
disabled={isPlaceholderData}
449+
onClick={() => void handleRestore(resource)}
450+
>
440451
Restore
441452
</Chip>
442453
)

0 commit comments

Comments
 (0)