mirror of
https://github.com/bitwarden/mobile.git
synced 2024-11-23 11:45:38 +01:00
set main page
This commit is contained in:
parent
7f2c265965
commit
a4cbf3bee3
@ -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 New Issue
Block a user