mirror of
https://github.com/bitwarden/mobile
synced 2025-12-15 07:43:37 +00:00
Use monotonic clock for vault timeout (#1175)
* Use monotonic clock for vault timeout * free memory * removed vault timeout timers and added crash logging to iOS clock hack
This commit is contained in:
@@ -90,13 +90,13 @@ namespace Bit.Core.Services
|
||||
{
|
||||
return;
|
||||
}
|
||||
var lastActive = await _storageService.GetAsync<DateTime?>(Constants.LastActiveKey);
|
||||
var lastActive = await _storageService.GetAsync<long?>(Constants.LastActiveKey);
|
||||
if (lastActive == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var diff = DateTime.UtcNow - lastActive.Value;
|
||||
if (diff.TotalSeconds >= vaultTimeout.Value)
|
||||
var diff = _platformUtilsService.GetActiveTime() - lastActive;
|
||||
if (diff >= vaultTimeout * 60)
|
||||
{
|
||||
// Pivot based on saved action
|
||||
var action = await _storageService.GetAsync<string>(Constants.VaultTimeoutActionKey);
|
||||
|
||||
Reference in New Issue
Block a user