mirror of
https://github.com/bitwarden/android.git
synced 2024-12-24 01:48:25 +03:00
set main page
This commit is contained in:
parent
7f2c265965
commit
a4cbf3bee3
1 changed files with 15 additions and 12 deletions
|
@ -6,8 +6,8 @@ using Bit.App.Utilities;
|
|||
using Bit.Core.Abstractions;
|
||||
using Bit.Core.Utilities;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.StyleSheets;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
|
@ -31,17 +31,7 @@ namespace Bit.App
|
|||
SetCulture();
|
||||
ThemeManager.SetTheme("light");
|
||||
MainPage = new HomePage();
|
||||
_userService.IsAuthenticatedAsync().ContinueWith(async authed =>
|
||||
{
|
||||
if(await authed)
|
||||
{
|
||||
Current.MainPage = new TabsPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
Current.MainPage = new HomePage();
|
||||
}
|
||||
});
|
||||
var mainPageTask = SetMainPageAsync();
|
||||
|
||||
ServiceContainer.Resolve<MobilePlatformUtilsService>("platformUtilsService").Init();
|
||||
_broadcasterService.Subscribe(nameof(App), async (message) =>
|
||||
|
@ -88,5 +78,18 @@ namespace Bit.App
|
|||
new System.Globalization.HijriCalendar();
|
||||
new System.Globalization.UmAlQuraCalendar();
|
||||
}
|
||||
|
||||
private async Task SetMainPageAsync()
|
||||
{
|
||||
var authed = await _userService.IsAuthenticatedAsync();
|
||||
if(authed)
|
||||
{
|
||||
Current.MainPage = new TabsPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
Current.MainPage = new HomePage();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue