Skip to content

Commit

Permalink
Addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SohamDas2021 committed Apr 9, 2024
1 parent caeaad9 commit 8db7405
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private async Task BrowseButtonClick(object sender)
}
}

private int MoveDirectory(string sourceDirectory, string targetDirectory)
private bool MoveDirectory(string sourceDirectory, string targetDirectory)
{
try
{
Expand Down Expand Up @@ -123,13 +123,13 @@ private int MoveDirectory(string sourceDirectory, string targetDirectory)

// Delete the source directory
Directory.Delete(sourceDirectory, true);
return 0;
return true;
}
catch (Exception ex)
{
Log.Error($"Error in MoveDirectory. Error: {ex}");
TelemetryFactory.Get<ITelemetry>().LogError("DevDriveInsights_PackageCacheMoveDirectory_Error", LogLevel.Critical, new ExceptionEvent(ex.HResult, sourceDirectory));
return ex.HResult;
return false;
}
}

Expand Down Expand Up @@ -169,7 +169,7 @@ private void DirectoryInputConfirmed()
// TODO: If chosen folder not a dev drive location, currently we no-op and log the error. Instead we should display the error.
if (ChosenDirectoryInDevDrive(directoryPath))
{
if (MoveDirectory(ExistingCacheLocation, directoryPath) == 0)
if (MoveDirectory(ExistingCacheLocation, directoryPath))
{
SetEnvironmentVariable(EnvironmentVariableToBeSet, directoryPath);
Log.Debug($"Moved cache from {ExistingCacheLocation} to {directoryPath}");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<Page
x:Class="DevHome.Customization.Views.DevDriveInsightsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<Page
x:Class="DevHome.Customization.Views.DevDriveInsightsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:behaviors="using:DevHome.Common.Behaviors"
xmlns:views="using:DevHome.Customization.Views"
behaviors:NavigationViewHeaderBehavior.HeaderTemplate="{StaticResource BreadcrumbBarDataTemplate}"
behaviors:NavigationViewHeaderBehavior.HeaderContext="{x:Bind ViewModel}">

<Grid MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<ScrollView Grid.Row="1" VerticalAlignment="Top">
<views:DevDriveInsightsView />
</ScrollView>
</Grid>
</Page>
xmlns:views="using:DevHome.Customization.Views"
behaviors:NavigationViewHeaderBehavior.HeaderTemplate="{StaticResource BreadcrumbBarDataTemplate}"
behaviors:NavigationViewHeaderBehavior.HeaderContext="{x:Bind ViewModel}">

<Grid MaxWidth="{ThemeResource MaxPageContentWidth}" Margin="{ThemeResource ContentPageMargin}">
<ScrollView Grid.Row="1" VerticalAlignment="Top">
<views:DevDriveInsightsView />
</ScrollView>
</Grid>
</Page>

0 comments on commit 8db7405

Please sign in to comment.