Skip to content

Commit 22c88c8

Browse files
authored
Servicing: v2.4.61 (#11972)
1 parent f616232 commit 22c88c8

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/Files.App/Helpers/QuickLookHelpers.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ public static async Task ToggleQuickLook(string path, bool switchPreview = false
1818
{
1919
bool isQuickLookAvailable = await DetectQuickLookAvailability();
2020

21-
if (isQuickLookAvailable == false)
21+
if (!isQuickLookAvailable)
2222
{
23-
App.Logger.LogInformation("QuickLook not detected");
23+
if (!switchPreview)
24+
App.Logger.LogInformation("QuickLook not detected");
25+
2426
return;
2527
}
2628

@@ -76,4 +78,4 @@ static async Task<int> QuickLookServerAvailable()
7678
return false;
7779
}
7880
}
79-
}
81+
}

src/Files.App/ViewModels/FolderSettingsViewModel.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,14 @@ public bool IsLayoutModeChanging
9494
set => SetProperty(ref isLayoutModeChanging, value);
9595
}
9696

97-
public Type GetLayoutType(string folderPath)
97+
public Type GetLayoutType(string folderPath, bool changeLayoutMode = true)
9898
{
9999
var prefsForPath = GetLayoutPreferencesForPath(folderPath);
100-
IsLayoutModeChanging = LayoutPreference.LayoutMode != prefsForPath.LayoutMode;
101-
LayoutPreference = prefsForPath;
100+
if (changeLayoutMode)
101+
{
102+
IsLayoutModeChanging = LayoutPreference.LayoutMode != prefsForPath.LayoutMode;
103+
LayoutPreference = prefsForPath;
104+
}
102105

103106
return (prefsForPath.LayoutMode) switch
104107
{

src/Files.App/Views/BaseShellPage.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,10 @@ public void ResetNavigationStackLayoutMode()
486486
{
487487
foreach (PageStackEntry entry in ItemDisplay.BackStack.ToList())
488488
{
489-
if (entry.Parameter is NavigationArguments args)
489+
if (entry.Parameter is NavigationArguments args &&
490+
args.NavPathParam is not null and not "Home")
490491
{
491-
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam);
492+
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam, false);
492493
if (!entry.SourcePageType.Equals(correctPageType))
493494
{
494495
int index = ItemDisplay.BackStack.IndexOf(entry);
@@ -501,9 +502,10 @@ public void ResetNavigationStackLayoutMode()
501502

502503
foreach (PageStackEntry entry in ItemDisplay.ForwardStack.ToList())
503504
{
504-
if (entry.Parameter is NavigationArguments args)
505+
if (entry.Parameter is NavigationArguments args &&
506+
args.NavPathParam is not null and not "Home")
505507
{
506-
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam);
508+
var correctPageType = FolderSettings.GetLayoutType(args.NavPathParam, false);
507509
if (!entry.SourcePageType.Equals(correctPageType))
508510
{
509511
int index = ItemDisplay.ForwardStack.IndexOf(entry);

0 commit comments

Comments
 (0)