Skip to content

Commit

Permalink
fix(DriveFileManager): Fetch Drive from primary key
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien-coye committed Feb 17, 2025
1 parent d857bcf commit 1c1e70c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions kDriveCore/Data/Cache/DriveFileManager/DriveFileManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,8 @@ public final class DriveFileManager {

private var _drive: Drive
public var drive: Drive {
guard let freshFrozenDrive = driveInfoDatabase.fetchObject(ofType: Drive.self, filtering: { lazyCollection in
return lazyCollection
.filter("id = %lld", driveId)
.first?
.freeze()
}) else {
guard let freshFrozenDrive = driveInfoDatabase.fetchObject(ofType: Drive.self, forPrimaryKey: _drive.objectId)?.freeze()
else {
return _drive
}
_drive = freshFrozenDrive
Expand Down

0 comments on commit 1c1e70c

Please sign in to comment.