diff --git a/src/App/Pages/TabsPage.cs b/src/App/Pages/TabsPage.cs index 9227aafaa..d85ff60a9 100644 --- a/src/App/Pages/TabsPage.cs +++ b/src/App/Pages/TabsPage.cs @@ -7,7 +7,7 @@ namespace Bit.App.Pages { public TabsPage() { - var groupingsPage = new NavigationPage(new GroupingsPage()) + var groupingsPage = new NavigationPage(new GroupingsPage(true)) { Title = AppResources.MyVault, Icon = "lock.png" diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs index abb497116..d3a16219c 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPage.xaml.cs @@ -2,6 +2,7 @@ using Bit.Core.Abstractions; using Bit.Core.Enums; using Bit.Core.Utilities; +using System; using System.Threading.Tasks; using Xamarin.Forms; @@ -12,14 +13,12 @@ namespace Bit.App.Pages private readonly IBroadcasterService _broadcasterService; private readonly ISyncService _syncService; private readonly GroupingsPageViewModel _vm; - - public GroupingsPage() - : this(true) - { } + private readonly string _pageName; public GroupingsPage(bool mainPage, CipherType? type = null, string folderId = null, string collectionId = null, string pageTitle = null) { + _pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks); InitializeComponent(); SetActivityIndicator(_mainContent); _broadcasterService = ServiceContainer.Resolve("broadcasterService"); @@ -49,7 +48,7 @@ namespace Bit.App.Pages { base.OnAppearing(); // await _syncService.FullSyncAsync(true); - _broadcasterService.Subscribe(nameof(GroupingsPage), async (message) => + _broadcasterService.Subscribe(_pageName, async (message) => { if(message.Command == "syncCompleted") { @@ -78,7 +77,7 @@ namespace Bit.App.Pages protected override void OnDisappearing() { base.OnDisappearing(); - _broadcasterService.Unsubscribe(nameof(GroupingsPage)); + _broadcasterService.Unsubscribe(_pageName); } private async void RowSelected(object sender, SelectedItemChangedEventArgs e)