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 23b4500
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ 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))
files = AnyRealmCollection(AnyRealmCollection(liveDirectory.children).filesSorted(by: sortType))
}

required init(driveFileManager: DriveFileManager, currentDirectory: File?) {
Expand Down

0 comments on commit 23b4500

Please sign in to comment.