1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-27 12:26:31 +01:00

check app options ios extension on nfc check (#933)

This commit is contained in:
Kyle Spearrin 2020-05-29 15:25:06 -04:00 committed by GitHub
parent 6da0f82ddd
commit fbf3d97d57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 8 deletions

View File

@ -43,7 +43,7 @@ namespace Bit.App
public App(AppOptions appOptions) public App(AppOptions appOptions)
{ {
Options = appOptions ?? new AppOptions(); Options = appOptions ?? new AppOptions();
if (Options.EmptyApp) if (Options.IosExtension)
{ {
Current = this; Current = this;
return; return;

View File

@ -18,6 +18,6 @@ namespace Bit.App.Models
public string SaveCardExpMonth { get; set; } public string SaveCardExpMonth { get; set; }
public string SaveCardExpYear { get; set; } public string SaveCardExpYear { get; set; }
public string SaveCardCode { get; set; } public string SaveCardCode { get; set; }
public bool EmptyApp { get; set; } public bool IosExtension { get; set; }
} }
} }

View File

@ -291,7 +291,7 @@ namespace Bit.iOS.Autofill
private void LaunchLoginFlow() private void LaunchLoginFlow()
{ {
var loginPage = new LoginPage(); 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.SetTheme(false, app.Resources);
ThemeManager.ApplyResourcesToPage(loginPage); ThemeManager.ApplyResourcesToPage(loginPage);
if (loginPage.BindingContext is LoginPageViewModel vm) if (loginPage.BindingContext is LoginPageViewModel vm)
@ -311,7 +311,7 @@ namespace Bit.iOS.Autofill
private void LaunchTwoFactorFlow() private void LaunchTwoFactorFlow()
{ {
var twoFactorPage = new TwoFactorPage(); 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.SetTheme(false, app.Resources);
ThemeManager.ApplyResourcesToPage(twoFactorPage); ThemeManager.ApplyResourcesToPage(twoFactorPage);
if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm) if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)

View File

@ -295,7 +295,11 @@ namespace Bit.iOS.Core.Services
public bool SupportsNfc() public bool SupportsNfc()
{ {
return CoreNFC.NFCNdefReaderSession.ReadingAvailable; if(Application.Current is App.App currentApp && !currentApp.Options.IosExtension)
{
return CoreNFC.NFCNdefReaderSession.ReadingAvailable;
}
return false;
} }
public bool SupportsCamera() public bool SupportsCamera()
@ -350,7 +354,7 @@ namespace Bit.iOS.Core.Services
public Task<string> DisplayActionSheetAsync(string title, string cancel, string destruction, public Task<string> DisplayActionSheetAsync(string title, string cancel, string destruction,
params string[] buttons) 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); return app.MainPage.DisplayActionSheet(title, cancel, destruction, buttons);
} }

View File

@ -423,7 +423,7 @@ namespace Bit.iOS.Extension
private void LaunchLoginFlow() private void LaunchLoginFlow()
{ {
var loginPage = new LoginPage(); 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.SetTheme(false, app.Resources);
ThemeManager.ApplyResourcesToPage(loginPage); ThemeManager.ApplyResourcesToPage(loginPage);
if (loginPage.BindingContext is LoginPageViewModel vm) if (loginPage.BindingContext is LoginPageViewModel vm)
@ -443,7 +443,7 @@ namespace Bit.iOS.Extension
private void LaunchTwoFactorFlow() private void LaunchTwoFactorFlow()
{ {
var twoFactorPage = new TwoFactorPage(); 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.SetTheme(false, app.Resources);
ThemeManager.ApplyResourcesToPage(twoFactorPage); ThemeManager.ApplyResourcesToPage(twoFactorPage);
if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm) if (twoFactorPage.BindingContext is TwoFactorPageViewModel vm)