Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jan 2, 2025
1 parent 86776e9 commit 7508f0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions iOSClient/Data/NCManageDatabase+RecommendedFiles.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ extension NCManageDatabase {
let realm = try Realm()

try realm.write {
// Removed all objct for account
let results = realm.objects(tableRecommendedFiles.self).filter("account == %@", account)

realm.delete(results)

// Added the new recommendations
for recommendation in recommendations {
let recommendedFile = tableRecommendedFiles(account: account, id: recommendation.id, timestamp: recommendation.timestamp, name: recommendation.name, directory: recommendation.directory, extensionType: recommendation.extensionType, mimeType: recommendation.mimeType, hasPreview: recommendation.hasPreview, reason: recommendation.reason)
realm.add(recommendedFile)
Expand Down

0 comments on commit 7508f0d

Please sign in to comment.