mirror of
https://github.com/bitwarden/mobile
synced 2026-01-03 09:03:35 +00:00
handle timers more appropriately
This commit is contained in:
@@ -169,19 +169,6 @@ namespace Bit.App.Pages
|
||||
};
|
||||
|
||||
ScrollView = new ScrollView { Content = DisabledStackLayout };
|
||||
|
||||
UpdateEnabled();
|
||||
Device.StartTimer(new TimeSpan(0, 0, 3), () =>
|
||||
{
|
||||
if(_pageDisappeared)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateEnabled();
|
||||
return true;
|
||||
});
|
||||
|
||||
Title = AppResources.AutofillAccessibilityService;
|
||||
Content = ScrollView;
|
||||
}
|
||||
@@ -189,6 +176,19 @@ namespace Bit.App.Pages
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
_pageDisappeared = false;
|
||||
UpdateEnabled();
|
||||
Device.StartTimer(new TimeSpan(0, 0, 3), () =>
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Check timer on accessibility");
|
||||
if(_pageDisappeared)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
UpdateEnabled();
|
||||
return true;
|
||||
});
|
||||
|
||||
base.OnAppearing();
|
||||
}
|
||||
|
||||
@@ -200,7 +200,8 @@ namespace Bit.App.Pages
|
||||
|
||||
private void UpdateEnabled()
|
||||
{
|
||||
ScrollView.Content = _appInfoService.AutofillAccessibilityServiceEnabled ? EnabledStackLayout : DisabledStackLayout;
|
||||
ScrollView.Content = _appInfoService.AutofillAccessibilityServiceEnabled ?
|
||||
EnabledStackLayout : DisabledStackLayout;
|
||||
}
|
||||
|
||||
private Label BuildServiceLabel()
|
||||
|
||||
@@ -120,10 +120,17 @@ namespace Bit.App.Pages
|
||||
};
|
||||
|
||||
ScrollView = new ScrollView { Content = DisabledStackLayout };
|
||||
Title = AppResources.AutofillService;
|
||||
Content = ScrollView;
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
_pageDisappeared = false;
|
||||
UpdateEnabled();
|
||||
Device.StartTimer(new TimeSpan(0, 0, 2), () =>
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Check timer on autofill");
|
||||
if(_pageDisappeared)
|
||||
{
|
||||
return false;
|
||||
@@ -133,13 +140,6 @@ namespace Bit.App.Pages
|
||||
return true;
|
||||
});
|
||||
|
||||
Title = AppResources.AutofillService;
|
||||
Content = ScrollView;
|
||||
}
|
||||
|
||||
protected override void OnAppearing()
|
||||
{
|
||||
_pageDisappeared = false;
|
||||
base.OnAppearing();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user