1
0
mirror of https://github.com/bitwarden/mobile synced 2025-12-23 19:53:50 +00:00

prevent rapid clicking actions that crash app

This commit is contained in:
Kyle Spearrin
2017-05-20 12:36:09 -04:00
parent 3415be4c56
commit bc6ff3e3bc
9 changed files with 73 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ namespace Bit.App.Pages
private readonly IAuthService _authService;
private readonly IUserDialogs _userDialogs;
private readonly ISettings _settings;
private DateTime? _lastAction;
public HomePage()
: base(updateActivity: false)
@@ -92,11 +93,23 @@ namespace Bit.App.Pages
public async Task LoginAsync()
{
if(_lastAction.LastActionWasRecent())
{
return;
}
_lastAction = DateTime.UtcNow;
await Navigation.PushForDeviceAsync(new LoginPage());
}
public async Task RegisterAsync()
{
if(_lastAction.LastActionWasRecent())
{
return;
}
_lastAction = DateTime.UtcNow;
await Navigation.PushForDeviceAsync(new RegisterPage(this));
}