1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-10 20:43:41 +00:00

Merge branch 'feature/maui-migration' into feature/maui-migration-passkeys

This commit is contained in:
Federico Maccaroni
2024-01-17 13:22:47 -03:00
8 changed files with 61 additions and 23 deletions

View File

@@ -9,6 +9,7 @@
x:DataType="pages:HomeViewModel"
HideSoftInputOnTapped="True"
x:Name="_page"
Loaded="HomePage_Loaded"
Title="{Binding PageTitle}">
<ContentPage.BindingContext>
<pages:HomeViewModel />

View File

@@ -1,8 +1,8 @@
using Bit.App.Models;
using Bit.App.Abstractions;
using Bit.App.Models;
using Bit.App.Utilities;
using Bit.Core.Abstractions;
using Bit.Core.Utilities;
using Microsoft.Maui.Platform;
namespace Bit.App.Pages
{
@@ -44,6 +44,21 @@ namespace Bit.App.Pages
}
}
public bool PerformNavigationOnAccountChangedOnLoad { get; internal set; }
void HomePage_Loaded(System.Object sender, System.EventArgs e)
{
#if ANDROID
// WORKAROUND: This is needed to fix the navigation when coming back from autofill when Accessibility Services is enabled
// See App.xaml.cs -> CreateWindow(...) for more info.
if (PerformNavigationOnAccountChangedOnLoad && ServiceContainer.TryResolve<IAccountsManager>(out var accountsManager))
{
PerformNavigationOnAccountChangedOnLoad = false;
accountsManager.NavigateOnAccountChangeAsync().FireAndForget();
}
#endif
}
public async Task DismissRegisterPageAndLogInAsync(string email)
{
await Navigation.PopModalAsync();

View File

@@ -41,11 +41,11 @@ namespace Bit.App.Pages
private async Task GoToImportItemsAsync()
{
var webVaultUrl = _environmentService.GetWebVaultUrl();
var body = string.Format(AppResources.YouCanImportDataToYourVaultOnX, webVaultUrl);
var toolsImportUrl = string.Format(ExternalLinksConstants.WEB_VAULT_TOOLS_IMPORT_FORMAT, _environmentService.GetWebVaultUrl());
var body = string.Format(AppResources.YouCanImportDataToYourVaultOnX, toolsImportUrl);
if (await _platformUtilsService.ShowDialogAsync(body, AppResources.ContinueToWebApp, AppResources.Continue, AppResources.Cancel))
{
_platformUtilsService.LaunchUri(webVaultUrl);
_platformUtilsService.LaunchUri(toolsImportUrl);
}
}
}