mirror of
https://github.com/bitwarden/mobile
synced 2025-12-24 04:04:34 +00:00
remove uri extra after captured
This commit is contained in:
@@ -29,6 +29,11 @@ namespace Bit.Android
|
||||
protected override void OnCreate(Bundle bundle)
|
||||
{
|
||||
var uri = Intent.GetStringExtra("uri");
|
||||
if(Intent.HasExtra("uri"))
|
||||
{
|
||||
Intent.RemoveExtra("uri");
|
||||
}
|
||||
|
||||
if(uri != null && !Resolver.IsSet)
|
||||
{
|
||||
MainApplication.SetIoc(Application);
|
||||
|
||||
@@ -95,7 +95,12 @@ namespace Bit.App
|
||||
|
||||
MessagingCenter.Subscribe<Application>(Current, "SetMainPage", (sender) =>
|
||||
{
|
||||
_setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource);
|
||||
_setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource, 1000);
|
||||
});
|
||||
|
||||
MessagingCenter.Subscribe<Application>(Current, "SetMainPageNow", (sender) =>
|
||||
{
|
||||
_setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource, 0);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -114,7 +119,7 @@ namespace Bit.App
|
||||
// Handle when your app sleeps
|
||||
Debug.WriteLine("OnSleep");
|
||||
|
||||
_setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource);
|
||||
_setMainPageCancellationTokenSource = SetMainPageFromAutofill(_setMainPageCancellationTokenSource, 1000);
|
||||
if(Device.OS == TargetPlatform.Android && !TopPageIsLock())
|
||||
{
|
||||
_settings.AddOrUpdateValue(Constants.LastActivityDate, DateTime.UtcNow);
|
||||
@@ -144,7 +149,7 @@ namespace Bit.App
|
||||
}
|
||||
}
|
||||
|
||||
private CancellationTokenSource SetMainPageFromAutofill(CancellationTokenSource previousCts)
|
||||
private CancellationTokenSource SetMainPageFromAutofill(CancellationTokenSource previousCts, int delay)
|
||||
{
|
||||
if(Device.OS != TargetPlatform.Android)
|
||||
{
|
||||
@@ -160,7 +165,7 @@ namespace Bit.App
|
||||
var cts = new CancellationTokenSource();
|
||||
Task.Run(async () =>
|
||||
{
|
||||
await Task.Delay(1000);
|
||||
await Task.Delay(delay);
|
||||
if(cts.Token.IsCancellationRequested)
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace Bit.App.Pages
|
||||
|
||||
private void ClickedItem(object sender, EventArgs e)
|
||||
{
|
||||
Application.Current.MainPage = new MainPage();
|
||||
MessagingCenter.Send(Application.Current, "SetMainPageNow");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user