From db586a87b25e98103150132a87fa90f32d0df0f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Coye=20de=20Brune=CC=81lis?= Date: Thu, 19 Dec 2024 11:19:52 +0100 Subject: [PATCH] fix(TrashListViewModel): Empty trash logic was not checking the correct source of truth --- kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift b/kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift index 65b793eaf..219caec07 100644 --- a/kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift +++ b/kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift @@ -81,8 +81,9 @@ class TrashListViewModel: InMemoryFileListViewModel { endRefreshing() if currentDirectory.id == DriveFileManager.trashRootFile.id { - currentRightBarButtons = files.isEmpty ? nil : [.emptyTrash] + currentRightBarButtons = currentDirectory.children.isEmpty ? nil : [.emptyTrash] } + if let nextCursor = fetchResponse.validApiResponse.cursor { try await loadFiles(cursor: nextCursor) }