Skip to content

Commit 220f6a4

Browse files
authored
Fix: Fixed issue where tab icons and labels are sometimes not displayed at app launch (#13849)
1 parent 515c476 commit 220f6a4

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/Files.App/Data/EventArguments/PaneNavigationArguments.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,24 @@ internal class PaneNavigationArguments
1212
public string? RightPaneNavPathParam { get; set; }
1313

1414
public string? RightPaneSelectItemParam { get; set; }
15+
16+
public static bool operator ==(PaneNavigationArguments? a1, PaneNavigationArguments? a2)
17+
{
18+
if (a1 is null && a2 is null)
19+
return true;
20+
21+
if (a1 is null || a2 is null)
22+
return false;
23+
24+
return a1.LeftPaneNavPathParam == a2.LeftPaneNavPathParam &&
25+
a1.LeftPaneSelectItemParam == a2.LeftPaneSelectItemParam &&
26+
a1.RightPaneNavPathParam == a2.RightPaneNavPathParam &&
27+
a1.RightPaneSelectItemParam == a2.RightPaneSelectItemParam;
28+
}
29+
30+
public static bool operator !=(PaneNavigationArguments? a1, PaneNavigationArguments? a2)
31+
{
32+
return !(a1 == a2);
33+
}
1534
}
1635
}

src/Files.App/ViewModels/MainPageViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ public async Task UpdateTabInfoAsync(Files.App.UserControls.TabBar.TabBarItem ta
187187
}
188188

189189
// Don't update tabItem if the contents of the tab have already changed
190-
if (result.Item1 is not null && navigationArg == tabItem.NavigationParameter.NavigationParameter)
190+
if (result.Item1 is not null &&
191+
(navigationArg is PaneNavigationArguments && navigationArg as PaneNavigationArguments == tabItem.NavigationParameter.NavigationParameter as PaneNavigationArguments
192+
|| navigationArg is string && navigationArg as string == tabItem.NavigationParameter.NavigationParameter as string))
191193
(tabItem.Header, tabItem.IconSource, tabItem.ToolTipText) = result;
192194
}
193195

0 commit comments

Comments
 (0)