page name for groupings

This commit is contained in:
Kyle Spearrin 2019-05-14 09:48:40 -04:00
parent 4f4c6064db
commit f0a96759a4
2 changed files with 6 additions and 7 deletions

View file

@ -7,7 +7,7 @@ namespace Bit.App.Pages
{ {
public TabsPage() public TabsPage()
{ {
var groupingsPage = new NavigationPage(new GroupingsPage()) var groupingsPage = new NavigationPage(new GroupingsPage(true))
{ {
Title = AppResources.MyVault, Title = AppResources.MyVault,
Icon = "lock.png" Icon = "lock.png"

View file

@ -2,6 +2,7 @@
using Bit.Core.Abstractions; using Bit.Core.Abstractions;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xamarin.Forms; using Xamarin.Forms;
@ -12,14 +13,12 @@ namespace Bit.App.Pages
private readonly IBroadcasterService _broadcasterService; private readonly IBroadcasterService _broadcasterService;
private readonly ISyncService _syncService; private readonly ISyncService _syncService;
private readonly GroupingsPageViewModel _vm; private readonly GroupingsPageViewModel _vm;
private readonly string _pageName;
public GroupingsPage()
: this(true)
{ }
public GroupingsPage(bool mainPage, CipherType? type = null, string folderId = null, public GroupingsPage(bool mainPage, CipherType? type = null, string folderId = null,
string collectionId = null, string pageTitle = null) string collectionId = null, string pageTitle = null)
{ {
_pageName = string.Concat(nameof(GroupingsPage), "_", DateTime.UtcNow.Ticks);
InitializeComponent(); InitializeComponent();
SetActivityIndicator(_mainContent); SetActivityIndicator(_mainContent);
_broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService"); _broadcasterService = ServiceContainer.Resolve<IBroadcasterService>("broadcasterService");
@ -49,7 +48,7 @@ namespace Bit.App.Pages
{ {
base.OnAppearing(); base.OnAppearing();
// await _syncService.FullSyncAsync(true); // await _syncService.FullSyncAsync(true);
_broadcasterService.Subscribe(nameof(GroupingsPage), async (message) => _broadcasterService.Subscribe(_pageName, async (message) =>
{ {
if(message.Command == "syncCompleted") if(message.Command == "syncCompleted")
{ {
@ -78,7 +77,7 @@ namespace Bit.App.Pages
protected override void OnDisappearing() protected override void OnDisappearing()
{ {
base.OnDisappearing(); base.OnDisappearing();
_broadcasterService.Unsubscribe(nameof(GroupingsPage)); _broadcasterService.Unsubscribe(_pageName);
} }
private async void RowSelected(object sender, SelectedItemChangedEventArgs e) private async void RowSelected(object sender, SelectedItemChangedEventArgs e)