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:
parent
6da0f82ddd
commit
fbf3d97d57
@ -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;
|
||||||
|
@ -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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user