mirror of
https://github.com/bitwarden/android.git
synced 2024-12-25 02:18:27 +03:00
check app options ios extension on nfc check (#933)
This commit is contained in:
parent
6da0f82ddd
commit
fbf3d97d57
5 changed files with 12 additions and 8 deletions
|
@ -43,7 +43,7 @@ namespace Bit.App
|
|||
public App(AppOptions appOptions)
|
||||
{
|
||||
Options = appOptions ?? new AppOptions();
|
||||
if (Options.EmptyApp)
|
||||
if (Options.IosExtension)
|
||||
{
|
||||
Current = this;
|
||||
return;
|
||||
|
|
|
@ -18,6 +18,6 @@ namespace Bit.App.Models
|
|||
public string SaveCardExpMonth { get; set; }
|
||||
public string SaveCardExpYear { get; set; }
|
||||
public string SaveCardCode { get; set; }
|
||||
public bool EmptyApp { get; set; }
|
||||
public bool IosExtension { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ namespace Bit.iOS.Autofill
|
|||
private void LaunchLoginFlow()
|
||||
{
|
||||
var loginPage = new LoginPage();
|
||||
var app = new App.App(new AppOptions { EmptyApp = true });
|
||||
var app = new App.App(new AppOptions { IosExtension = true });
|
||||
ThemeManager.SetTheme(false, app.Resources);
|
||||
ThemeManager.ApplyResourcesToPage(loginPage);
|
||||
if (loginPage.BindingContext is LoginPageViewModel vm)
|
||||
|
@ -311,7 +311,7 @@ namespace Bit.iOS.Autofill
|
|||
private void LaunchTwoFactorFlow()
|
||||
{
|
||||
var twoFactorPage = new TwoFactorPage();
|
||||
var app = new App.App(new AppOptions { EmptyApp = true });
|
||||
var app = new App.App(new AppOptions { IosExtension = true });
|
||||
ThemeManager.SetTheme(false, app.Resources);
|
||||
ThemeManager.ApplyResourcesToPage(twoFactorPage);
|
||||
if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)
|
||||
|
|
|
@ -294,9 +294,13 @@ namespace Bit.iOS.Core.Services
|
|||
}
|
||||
|
||||
public bool SupportsNfc()
|
||||
{
|
||||
if(Application.Current is App.App currentApp && !currentApp.Options.IosExtension)
|
||||
{
|
||||
return CoreNFC.NFCNdefReaderSession.ReadingAvailable;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool SupportsCamera()
|
||||
{
|
||||
|
@ -350,7 +354,7 @@ namespace Bit.iOS.Core.Services
|
|||
public Task<string> DisplayActionSheetAsync(string title, string cancel, string destruction,
|
||||
params string[] buttons)
|
||||
{
|
||||
if (Application.Current is App.App app && app.Options != null && !app.Options.EmptyApp)
|
||||
if (Application.Current is App.App app && app.Options != null && !app.Options.IosExtension)
|
||||
{
|
||||
return app.MainPage.DisplayActionSheet(title, cancel, destruction, buttons);
|
||||
}
|
||||
|
|
|
@ -423,7 +423,7 @@ namespace Bit.iOS.Extension
|
|||
private void LaunchLoginFlow()
|
||||
{
|
||||
var loginPage = new LoginPage();
|
||||
var app = new App.App(new AppOptions { EmptyApp = true });
|
||||
var app = new App.App(new AppOptions { IosExtension = true });
|
||||
ThemeManager.SetTheme(false, app.Resources);
|
||||
ThemeManager.ApplyResourcesToPage(loginPage);
|
||||
if (loginPage.BindingContext is LoginPageViewModel vm)
|
||||
|
@ -443,7 +443,7 @@ namespace Bit.iOS.Extension
|
|||
private void LaunchTwoFactorFlow()
|
||||
{
|
||||
var twoFactorPage = new TwoFactorPage();
|
||||
var app = new App.App(new AppOptions { EmptyApp = true });
|
||||
var app = new App.App(new AppOptions { IosExtension = true });
|
||||
ThemeManager.SetTheme(false, app.Resources);
|
||||
ThemeManager.ApplyResourcesToPage(twoFactorPage);
|
||||
if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)
|
||||
|
|
Loading…
Reference in a new issue