Skip to content

Commit

Permalink
Enabling DevHome to recognize when the same file is removed. (#2725)
Browse files Browse the repository at this point in the history
* Enabling DevHome to re-add the same path

* Removing error type check

* Typo

---------

Co-authored-by: Darren Hoehna <dahoehna@microsoft.com>
  • Loading branch information
dhoehna and dhoehna authored Apr 24, 2024
1 parent 0b90fa2 commit 3fa1032
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/SetupFlow/DevHome.SetupFlow/ViewModels/DevDriveViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public DevDriveViewModel(
/// This is the location that we will save the virtual disk file to.
/// </summary>
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(DriveLabel))]
[NotifyCanExecuteChangedFor(nameof(SaveButtonCommand))]
private string _location;

Expand Down Expand Up @@ -260,6 +261,17 @@ public async Task ChooseFolderLocationAsync()
if (!string.IsNullOrWhiteSpace(location?.Path))
{
_log.Information($"Selected Dev Drive location: {location.Path}");

// If the user encounters an error, like file already exists, then they fix the issue
// (deleted the file) DevHome won't check if the issue is resolved. A user needs to
// re-enter a path. If the path is the same as the previously entered path Location
// will not update because the two string values are similiar.
if (string.Equals(Location, location.Path, StringComparison.OrdinalIgnoreCase))
{
// Change Location to empty to force Location updates.
Location = string.Empty;
}

Location = location.Path;
}
else
Expand Down

0 comments on commit 3fa1032

Please sign in to comment.