Skip to content

Fix: Fixed issue where Format Drive option was visible for Cloud Drives #14525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public string DriveFileSystem
get => driveFileSystem;
set
{
DriveFileSystemVisibility = true;
SetProperty(ref driveFileSystem, value);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/Files.App/ViewModels/Properties/BasePropertiesPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
var props = new DriveProperties(ViewModel, drive, AppInstance);
BaseProperties = props;

ViewModel.FormatVisibility = !(props.Drive.Type == DriveType.Network || string.Equals(props.Drive.Path, "C:\\", StringComparison.OrdinalIgnoreCase));
ViewModel.FormatVisibility = !(props.Drive.Type == DriveType.Network
|| props.Drive.Type == DriveType.CloudDrive
|| string.Equals(props.Drive.Path, "C:\\", StringComparison.OrdinalIgnoreCase));
ViewModel.DriveFileSystemVisibility = props.Drive.Type != DriveType.CloudDrive;
ViewModel.CleanupDriveCommand = new AsyncRelayCommand(() => StorageSenseHelper.OpenStorageSenseAsync(props.Drive.Path));
ViewModel.FormatDriveCommand = new RelayCommand(async () =>
{
Expand Down