From a4a93f09995639816c92e1b51c14c115c6b71cf9 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 20 Dec 2017 00:11:15 -0500 Subject: [PATCH] remove my vault as default page options --- src/Android/MainActivity.cs | 2 +- .../Services/IAppSettingsService.cs | 1 - src/App/App.cs | 2 +- src/App/Constants.cs | 1 - src/App/Models/AppOptions.cs | 2 +- src/App/Pages/MainPage.cs | 7 +--- src/App/Pages/Settings/SettingsOptionsPage.cs | 41 +------------------ src/App/Pages/Vault/VaultAddCipherPage.cs | 2 +- src/App/Resources/AppResources.Designer.cs | 18 -------- src/App/Resources/AppResources.resx | 6 --- src/App/Services/AppSettingsService.cs | 12 ------ 11 files changed, 7 insertions(+), 87 deletions(-) diff --git a/src/Android/MainActivity.cs b/src/Android/MainActivity.cs index 694619248..61101dcfc 100644 --- a/src/Android/MainActivity.cs +++ b/src/Android/MainActivity.cs @@ -250,7 +250,7 @@ namespace Bit.Android var options = new AppOptions { Uri = Intent.GetStringExtra("uri") ?? Intent.GetStringExtra("autofillFrameworkUri"), - MyVault = Intent.GetBooleanExtra("myVaultTile", false), + MyVaultTile = Intent.GetBooleanExtra("myVaultTile", false), FromAutofillFramework = Intent.GetBooleanExtra("autofillFramework", false) }; diff --git a/src/App/Abstractions/Services/IAppSettingsService.cs b/src/App/Abstractions/Services/IAppSettingsService.cs index 7b9981717..f10fe8a5f 100644 --- a/src/App/Abstractions/Services/IAppSettingsService.cs +++ b/src/App/Abstractions/Services/IAppSettingsService.cs @@ -4,7 +4,6 @@ namespace Bit.App.Abstractions { public interface IAppSettingsService { - bool DefaultPageVault { get; set; } bool Locked { get; set; } DateTime LastActivity { get; set; } DateTime LastCacheClear { get; set; } diff --git a/src/App/App.cs b/src/App/App.cs index c302f744a..771cbb12a 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -78,7 +78,7 @@ namespace Bit.App } else { - MainPage = new MainPage(myVault: _options.MyVault); + MainPage = new MainPage(); } } else diff --git a/src/App/Constants.cs b/src/App/Constants.cs index 8070fd2b4..315920f05 100644 --- a/src/App/Constants.cs +++ b/src/App/Constants.cs @@ -13,7 +13,6 @@ public const string SettingDisableTotpCopy = "setting:disableAutoCopyTotp"; public const string AutofillPersistNotification = "setting:persistNotification"; public const string AutofillPasswordField = "setting:autofillPasswordField"; - public const string SettingDefaultPageVault = "setting:defaultPageVault"; public const string PasswordGeneratorLength = "pwGenerator:length"; public const string PasswordGeneratorUppercase = "pwGenerator:uppercase"; diff --git a/src/App/Models/AppOptions.cs b/src/App/Models/AppOptions.cs index 44e7ebede..e5d46f949 100644 --- a/src/App/Models/AppOptions.cs +++ b/src/App/Models/AppOptions.cs @@ -4,7 +4,7 @@ namespace Bit.App.Models { public class AppOptions { - public bool MyVault { get; set; } + public bool MyVaultTile { get; set; } public bool FromAutofillFramework { get; set; } public CipherType? FillType { get; set; } public string Uri { get; set; } diff --git a/src/App/Pages/MainPage.cs b/src/App/Pages/MainPage.cs index dcd2a2e36..afada596e 100644 --- a/src/App/Pages/MainPage.cs +++ b/src/App/Pages/MainPage.cs @@ -8,7 +8,7 @@ namespace Bit.App.Pages { public class MainPage : ExtendedTabbedPage { - public MainPage(bool myVault = false) + public MainPage() { TintColor = Color.FromHex("3c8dbc"); @@ -24,10 +24,7 @@ namespace Bit.App.Pages Children.Add(toolsNavigation); Children.Add(settingsNavigation); - if(myVault || Resolver.Resolve().DefaultPageVault) - { - SelectedItem = vaultNavigation; - } + SelectedItem = vaultNavigation; } } } diff --git a/src/App/Pages/Settings/SettingsOptionsPage.cs b/src/App/Pages/Settings/SettingsOptionsPage.cs index b1e5dfb34..d7517dd15 100644 --- a/src/App/Pages/Settings/SettingsOptionsPage.cs +++ b/src/App/Pages/Settings/SettingsOptionsPage.cs @@ -25,8 +25,6 @@ namespace Bit.App.Pages } private StackLayout StackLayout { get; set; } - private ExtendedSwitchCell DefaultPageVaultCell { get; set; } - private Label DefaultPageVaultLabel { get; set; } private ExtendedSwitchCell CopyTotpCell { get; set; } private Label CopyTotpLabel { get; set; } private ExtendedSwitchCell AnalyticsCell { get; set; } @@ -42,30 +40,13 @@ namespace Bit.App.Pages private void Init() { - DefaultPageVaultCell = new ExtendedSwitchCell - { - Text = AppResources.DefaultPageVault, - On = _appSettings.DefaultPageVault - }; - - var defaultPageVaultTable = new FormTableView(true) - { - Root = new TableRoot - { - new TableSection(Helpers.GetEmptyTableSectionTitle()) - { - DefaultPageVaultCell - } - } - }; - WebsiteIconsCell = new ExtendedSwitchCell { Text = AppResources.DisableWebsiteIcons, On = _appSettings.DisableWebsiteIcons }; - var websiteIconsTable = new FormTableView + var websiteIconsTable = new FormTableView(true) { Root = new TableRoot { @@ -110,11 +91,6 @@ namespace Bit.App.Pages } }; - DefaultPageVaultLabel = new FormTableLabel(this) - { - Text = AppResources.DefaultPageVaultDescription - }; - CopyTotpLabel = new FormTableLabel(this) { Text = AppResources.DisableAutoTotpCopyDescription @@ -134,7 +110,6 @@ namespace Bit.App.Pages { Children = { - defaultPageVaultTable, DefaultPageVaultLabel, websiteIconsTable, WebsiteIconsLabel, totpTable, CopyTotpLabel, analyticsTable, AnalyticsLabel @@ -239,7 +214,6 @@ namespace Bit.App.Pages { base.OnAppearing(); - DefaultPageVaultCell.OnChanged += DefaultPageVaultCell_Changed; AnalyticsCell.OnChanged += AnalyticsCell_Changed; WebsiteIconsCell.OnChanged += WebsiteIconsCell_Changed; CopyTotpCell.OnChanged += CopyTotpCell_OnChanged; @@ -257,7 +231,6 @@ namespace Bit.App.Pages { base.OnDisappearing(); - DefaultPageVaultCell.OnChanged -= DefaultPageVaultCell_Changed; AnalyticsCell.OnChanged -= AnalyticsCell_Changed; WebsiteIconsCell.OnChanged -= WebsiteIconsCell_Changed; CopyTotpCell.OnChanged -= CopyTotpCell_OnChanged; @@ -273,7 +246,6 @@ namespace Bit.App.Pages private void Layout_LayoutChanged(object sender, EventArgs e) { - DefaultPageVaultLabel.WidthRequest = StackLayout.Bounds.Width - DefaultPageVaultLabel.Bounds.Left * 2; AnalyticsLabel.WidthRequest = StackLayout.Bounds.Width - AnalyticsLabel.Bounds.Left * 2; WebsiteIconsLabel.WidthRequest = StackLayout.Bounds.Width - WebsiteIconsLabel.Bounds.Left * 2; CopyTotpLabel.WidthRequest = StackLayout.Bounds.Width - CopyTotpLabel.Bounds.Left * 2; @@ -295,17 +267,6 @@ namespace Bit.App.Pages } } - private void DefaultPageVaultCell_Changed(object sender, ToggledEventArgs e) - { - var cell = sender as ExtendedSwitchCell; - if(cell == null) - { - return; - } - - _appSettings.DefaultPageVault = cell.On; - } - private void WebsiteIconsCell_Changed(object sender, ToggledEventArgs e) { var cell = sender as ExtendedSwitchCell; diff --git a/src/App/Pages/Vault/VaultAddCipherPage.cs b/src/App/Pages/Vault/VaultAddCipherPage.cs index 6650581ed..6c4bc7e01 100644 --- a/src/App/Pages/Vault/VaultAddCipherPage.cs +++ b/src/App/Pages/Vault/VaultAddCipherPage.cs @@ -311,7 +311,7 @@ namespace Bit.App.Pages { if(_fromAutofillFramework) { - Application.Current.MainPage = new MainPage(true); + Application.Current.MainPage = new MainPage(); return true; } diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 258aa7f3e..17e1cf992 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -915,24 +915,6 @@ namespace Bit.App.Resources { } } - /// - /// Looks up a localized string similar to Default To "My Vault". - /// - public static string DefaultPageVault { - get { - return ResourceManager.GetString("DefaultPageVault", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Default to the "My Vault" page instead of "Favorites" whenever I open the app.. - /// - public static string DefaultPageVaultDescription { - get { - return ResourceManager.GetString("DefaultPageVaultDescription", resourceCulture); - } - } - /// /// Looks up a localized string similar to Delete. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index f2f57ab31..d16328959 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -1194,12 +1194,6 @@ Collections - - Default To "My Vault" - - - Default to the "My Vault" page instead of "Favorites" whenever I open the app. - There are no items in this collection. diff --git a/src/App/Services/AppSettingsService.cs b/src/App/Services/AppSettingsService.cs index a9bf2d641..be2bc2f01 100644 --- a/src/App/Services/AppSettingsService.cs +++ b/src/App/Services/AppSettingsService.cs @@ -14,18 +14,6 @@ namespace Bit.App.Services _settings = settings; } - public bool DefaultPageVault - { - get - { - return _settings.GetValueOrDefault(Constants.SettingDefaultPageVault, false); - } - set - { - _settings.AddOrUpdateValue(Constants.SettingDefaultPageVault, value); - } - } - public bool Locked { get