Skip to content

Commit

Permalink
Servicing: v2.4.61 (#11972)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaira2 authored Apr 5, 2023
1 parent f616232 commit 22c88c8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
8 changes: 5 additions & 3 deletions src/Files.App/Helpers/QuickLookHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ public static async Task ToggleQuickLook(string path, bool switchPreview = false
{
bool isQuickLookAvailable = await DetectQuickLookAvailability();

if (isQuickLookAvailable == false)
if (!isQuickLookAvailable)
{
App.Logger.LogInformation("QuickLook not detected");
if (!switchPreview)
App.Logger.LogInformation("QuickLook not detected");

return;
}

Expand Down Expand Up @@ -76,4 +78,4 @@ static async Task<int> QuickLookServerAvailable()
return false;
}
}
}
}
9 changes: 6 additions & 3 deletions src/Files.App/ViewModels/FolderSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ public bool IsLayoutModeChanging
set => SetProperty(ref isLayoutModeChanging, value);
}

public Type GetLayoutType(string folderPath)
public Type GetLayoutType(string folderPath, bool changeLayoutMode = true)
{
var prefsForPath = GetLayoutPreferencesForPath(folderPath);
IsLayoutModeChanging = LayoutPreference.LayoutMode != prefsForPath.LayoutMode;
LayoutPreference = prefsForPath;
if (changeLayoutMode)
{
IsLayoutModeChanging = LayoutPreference.LayoutMode != prefsForPath.LayoutMode;
LayoutPreference = prefsForPath;
}

return (prefsForPath.LayoutMode) switch
{
Expand Down
10 changes: 6 additions & 4 deletions src/Files.App/Views/BaseShellPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,10 @@ public void ResetNavigationStackLayoutMode()
{
foreach (PageStackEntry entry in ItemDisplay.BackStack.ToList())
{
if (entry.Parameter is NavigationArguments args)
if (entry.Parameter is NavigationArguments args &&
args.NavPathParam is not null and not "Home")
{
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam);
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam, false);
if (!entry.SourcePageType.Equals(correctPageType))
{
int index = ItemDisplay.BackStack.IndexOf(entry);
Expand All @@ -501,9 +502,10 @@ public void ResetNavigationStackLayoutMode()

foreach (PageStackEntry entry in ItemDisplay.ForwardStack.ToList())
{
if (entry.Parameter is NavigationArguments args)
if (entry.Parameter is NavigationArguments args &&
args.NavPathParam is not null and not "Home")
{
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam);
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam, false);
if (!entry.SourcePageType.Equals(correctPageType))
{
int index = ItemDisplay.ForwardStack.IndexOf(entry);
Expand Down

0 comments on commit 22c88c8

Please sign in to comment.