Skip to content

Commit 6f68c3c

Browse files
committed
Update DrivesViewModel.cs
1 parent 309ec4f commit 6f68c3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Files.App/Data/Models/DrivesViewModel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,12 @@ public async Task UpdateDrivesAsync()
103103
}
104104

105105
var osDrive = await removableDrivesService.GetPrimaryDriveAsync();
106+
var osDrivePath = osDrive.Id.EndsWith(Path.DirectorySeparatorChar)
107+
? osDrive.Id
108+
: $"{osDrive.Id}{Path.DirectorySeparatorChar}";
106109

107110
// Show consent dialog if the OS drive could not be accessed
108-
if (!Drives.Any(x => Path.GetFullPath(x.Id) == Path.GetFullPath(osDrive.Id)))
111+
if (Drives.All(x => Path.GetFullPath(x.Id) != osDrivePath))
109112
ShowUserConsentOnInit = true;
110113

111114
if (watcher.CanBeStarted)

0 commit comments

Comments
 (0)