Skip to content

Commit cbc4965

Browse files
committed
Fix: Fixed Columns View appearing in Recycle Bin when folder preference sync is enabled.
1 parent c2512cd commit cbc4965

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,28 @@ public static void SetLayoutPreferencesForPath(string path, LayoutPreferencesIte
503503
?? GetDefaultLayoutPreferences(path);
504504
}
505505

506+
if (path.StartsWith(Constants.UserEnvironmentPaths.RecycleBinPath, StringComparison.Ordinal))
507+
{
508+
var trimmedPath = path.TrimPath() ?? string.Empty;
509+
510+
var recycleBinPreference = SafetyExtensions.IgnoreExceptions(() =>
511+
{
512+
var folderFRN = Win32Helper.GetFolderFRN(trimmedPath);
513+
514+
return GetLayoutPreferencesFromDatabase(trimmedPath, folderFRN)
515+
?? GetLayoutPreferencesFromAds(trimmedPath, folderFRN);
516+
}, App.Logger);
517+
518+
if (recycleBinPreference is not null && recycleBinPreference.LayoutMode != FolderLayoutModes.ColumnView)
519+
return recycleBinPreference;
520+
521+
var defaultPref = new LayoutPreferencesItem();
522+
if (defaultPref.LayoutMode == FolderLayoutModes.ColumnView)
523+
defaultPref.LayoutMode = FolderLayoutModes.DetailsView;
524+
525+
return defaultPref;
526+
}
527+
506528
return new LayoutPreferencesItem();
507529
}
508530

0 commit comments

Comments
 (0)