Skip to content

Commit

Permalink
fix(TrashListViewModel): Empty trash button logic (#1359)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann authored Dec 19, 2024
2 parents a2713ad + db586a8 commit e93d303
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kDrive/UI/Controller/Menu/Trash/TrashListViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit e93d303

Please sign in to comment.