Skip to content

Commit

Permalink
fix: Unable to do a transaction with a frozen object
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Feb 5, 2024
1 parent 371fe29 commit 21c9a3d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class InMemoryFileListViewModel: FileListViewModel {
}

super.init(configuration: configuration, driveFileManager: driveFileManager, currentDirectory: currentDirectory)

let liveDirectory = try? currentDirectory.thaw()
try? realm.write {
realm.add(currentDirectory)
realm.add(liveDirectory)
}
files = AnyRealmCollection(AnyRealmCollection(currentDirectory.children).filesSorted(by: sortType))
}
Expand Down

0 comments on commit 21c9a3d

Please sign in to comment.