diff --git a/src/App/Pages/MainPage.cs b/src/App/Pages/MainPage.cs index 6dfefc7cf..e292ddd33 100644 --- a/src/App/Pages/MainPage.cs +++ b/src/App/Pages/MainPage.cs @@ -7,13 +7,13 @@ namespace Bit.App.Pages { public class MainPage : ExtendedTabbedPage { - public MainPage(string uri = null, bool myVault = false) + public MainPage(bool myVault = false) { TintColor = Color.FromHex("3c8dbc"); var settingsNavigation = new ExtendedNavigationPage(new SettingsPage()); - var favoritesNavigation = new ExtendedNavigationPage(new VaultListCiphersPage(true, uri)); - var vaultNavigation = new ExtendedNavigationPage(new VaultListCiphersPage(false, uri)); + var favoritesNavigation = new ExtendedNavigationPage(new VaultListCiphersPage(true)); + var vaultNavigation = new ExtendedNavigationPage(new VaultListCiphersPage(false)); var toolsNavigation = new ExtendedNavigationPage(new ToolsPage()); favoritesNavigation.Icon = "star.png"; @@ -26,7 +26,7 @@ namespace Bit.App.Pages Children.Add(toolsNavigation); Children.Add(settingsNavigation); - if(myVault || uri != null) + if(myVault) { SelectedItem = vaultNavigation; } diff --git a/src/App/Pages/Vault/VaultAutofillListCiphersPage.cs b/src/App/Pages/Vault/VaultAutofillListCiphersPage.cs index abb8e98a3..2cb6c7917 100644 --- a/src/App/Pages/Vault/VaultAutofillListCiphersPage.cs +++ b/src/App/Pages/Vault/VaultAutofillListCiphersPage.cs @@ -31,12 +31,11 @@ namespace Bit.App.Pages { Uri = uriString; - Uri uri; if(uriString?.StartsWith(Constants.AndroidAppProtocol) ?? false) { _name = uriString.Substring(Constants.AndroidAppProtocol.Length); } - else if(!System.Uri.TryCreate(uriString, UriKind.Absolute, out uri) || + else if(!System.Uri.TryCreate(uriString, UriKind.Absolute, out Uri uri) || !DomainName.TryParseBaseDomain(uri.Host, out _name)) { _name = "--"; @@ -331,7 +330,7 @@ namespace Bit.App.Pages { _page.GoogleAnalyticsService.TrackExtensionEvent("CloseToSearch", _page.Uri.StartsWith("http") ? "Website" : "App"); - Application.Current.MainPage = new MainPage(_page.Uri); + Application.Current.MainPage = new ExtendedNavigationPage(new VaultListCiphersPage(false, _page.Uri)); _page.UserDialogs.Toast(string.Format(AppResources.BitwardenAutofillServiceSearch, _page._name), TimeSpan.FromSeconds(10)); }