Skip to content

Commit 64007f0

Browse files
committed
Fix overeager Dropbox "synced" icons
1 parent 4e55d57 commit 64007f0

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src-tauri/src/file_system/sync_status.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,19 @@ fn get_sync_status(path: &Path) -> SyncStatus {
5959
}
6060
} else {
6161
// File has local content - could be synced or uploading
62-
if is_uploading(path) {
63-
SyncStatus::Uploading
64-
} else {
65-
SyncStatus::Synced
62+
// Use is_cloud_file() to check if this is actually a cloud file
63+
match is_uploading_cloud_file(path) {
64+
Some(true) => SyncStatus::Uploading,
65+
Some(false) => SyncStatus::Synced,
66+
None => SyncStatus::Unknown, // Not a cloud file
6667
}
6768
}
6869
}
6970

7071
/// Checks if file is currently uploading via NSURL resource values.
71-
fn is_uploading(path: &Path) -> bool {
72-
get_ubiquitous_bool(path, "NSURLUbiquitousItemIsUploadingKey").unwrap_or(false)
72+
/// Returns None if file is not a cloud file.
73+
fn is_uploading_cloud_file(path: &Path) -> Option<bool> {
74+
get_ubiquitous_bool(path, "NSURLUbiquitousItemIsUploadingKey")
7375
}
7476

7577
/// Checks if file is currently downloading via NSURL resource values.

0 commit comments

Comments
 (0)