Skip to content

Commit f0badb2

Browse files
authored
Fix: Fixed issue where tab icons and labels were sometimes not displayed when resuming (#14080)
1 parent f5d980c commit f0badb2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Files.App/Helpers/Navigation/NavigationHelpers.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,15 @@ private static async Task UpdateTabInfoAsync(TabBarItem tabItem, object navigati
114114
}
115115

116116
// Don't update tabItem if the contents of the tab have already changed
117-
if (result.Item1 is not null &&
118-
(navigationArg is PaneNavigationArguments && navigationArg as PaneNavigationArguments == tabItem.NavigationParameter.NavigationParameter as PaneNavigationArguments
119-
|| navigationArg is string && navigationArg as string == tabItem.NavigationParameter.NavigationParameter as string))
120-
(tabItem.Header, tabItem.IconSource, tabItem.ToolTipText) = result;
117+
if (result.Item1 is not null)
118+
{
119+
var navigationParameter = tabItem.NavigationParameter.NavigationParameter;
120+
var a1 = navigationParameter is PaneNavigationArguments pna1 ? pna1 : new PaneNavigationArguments() { LeftPaneNavPathParam = navigationParameter as string };
121+
var a2 = navigationArg is PaneNavigationArguments pna2 ? pna2 : new PaneNavigationArguments() { LeftPaneNavPathParam = navigationArg as string };
122+
123+
if (a1 == a2)
124+
(tabItem.Header, tabItem.IconSource, tabItem.ToolTipText) = result;
125+
}
121126
}
122127

123128
public static async Task<(string tabLocationHeader, IconSource tabIcon, string toolTipText)> GetSelectedTabInfoAsync(string currentPath)

0 commit comments

Comments
 (0)