Skip to content

Commit 73bde04

Browse files
committed
Fix
1 parent 567a252 commit 73bde04

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,33 @@ public bool IsOmnibarFocused
265265
}
266266

267267
private string _OmnibarCurrentSelectedModeName = OmnibarPathModeName;
268-
public string OmnibarCurrentSelectedModeName { get => _OmnibarCurrentSelectedModeName; set => SetProperty(ref _OmnibarCurrentSelectedModeName, value); }
268+
public string OmnibarCurrentSelectedModeName
269+
{
270+
get => _OmnibarCurrentSelectedModeName;
271+
set
272+
{
273+
if (SetProperty(ref _OmnibarCurrentSelectedModeName, value) && IsOmnibarFocused)
274+
{
275+
switch (value)
276+
{
277+
case OmnibarPathModeName:
278+
PathText =
279+
string.IsNullOrEmpty(ContentPageContext.ShellPage?.ShellViewModel?.WorkingDirectory)
280+
? Constants.UserEnvironmentPaths.HomePath
281+
: ContentPageContext.ShellPage.ShellViewModel.WorkingDirectory;
282+
_ = PopulateOmnibarSuggestionsForPathMode();
283+
break;
284+
case OmnibarPaletteModeName:
285+
PopulateOmnibarSuggestionsForCommandPaletteMode();
286+
break;
287+
case OmnibarSearchModeName:
288+
break;
289+
default:
290+
break;
291+
}
292+
}
293+
}
294+
}
269295

270296
private CurrentInstanceViewModel _InstanceViewModel;
271297
public CurrentInstanceViewModel InstanceViewModel

0 commit comments

Comments
 (0)