Skip to content

Commit 39d2ff1

Browse files
authored
Fix installation scope not being respected (#5099)
1 parent 9a242bc commit 39d2ff1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/UniGetUI.Avalonia/ViewModels/DialogPages/InstallOptionsViewModel.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ public InstallOptionsViewModel(IPackage package, OperationType operation, Instal
301301
string globalName = CoreTools.Translate(CommonTranslations.ScopeNames[PackageScope.Global]);
302302
ScopeOptions.Add(localName);
303303
ScopeOptions.Add(globalName);
304-
if (options.InstallationScope == "Local") SelectedScope = localName;
305-
if (options.InstallationScope == "Global") SelectedScope = globalName;
304+
if (options.InstallationScope == PackageScope.Local) SelectedScope = localName;
305+
if (options.InstallationScope == PackageScope.Global) SelectedScope = globalName;
306306
}
307307
ScopeEnabled = caps.SupportsCustomScopes;
308308

@@ -575,8 +575,8 @@ private void ApplyToOptions()
575575

576576
private static string ScopeToString(string? selected)
577577
{
578-
if (selected == CoreTools.Translate(CommonTranslations.ScopeNames[PackageScope.Local])) return "Local";
579-
if (selected == CoreTools.Translate(CommonTranslations.ScopeNames[PackageScope.Global])) return "Global";
578+
if (selected == CoreTools.Translate(CommonTranslations.ScopeNames[PackageScope.Local])) return PackageScope.Local;
579+
if (selected == CoreTools.Translate(CommonTranslations.ScopeNames[PackageScope.Global])) return PackageScope.Global;
580580
return "";
581581
}
582582

0 commit comments

Comments
 (0)