mirror of
https://github.com/bitwarden/android.git
synced 2024-12-18 23:31:52 +03:00
remove uri extra after captured
This commit is contained in:
parent
f66b26a866
commit
8c6d395d89
3 changed files with 15 additions and 5 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue