lock service fixes

This commit is contained in:
Kyle Spearrin 2019-05-16 12:29:55 -04:00
parent f317f45d14
commit 3eb1ab0452
1 changed files with 5 additions and 2 deletions

View File

@ -63,6 +63,10 @@ namespace Bit.Core.Services
{ {
return; return;
} }
if(await IsLockedAsync())
{
return;
}
var lockOption = _platformUtilsService.LockTimeout(); var lockOption = _platformUtilsService.LockTimeout();
if(lockOption == null) if(lockOption == null)
{ {
@ -77,9 +81,8 @@ namespace Bit.Core.Services
{ {
return; return;
} }
var lockOptionsSeconds = lockOption.Value * 60;
var diff = DateTime.UtcNow - lastActive.Value; var diff = DateTime.UtcNow - lastActive.Value;
if(diff.TotalSeconds >= lockOptionsSeconds) if(diff.TotalSeconds >= lockOption.Value)
{ {
// need to lock now // need to lock now
await LockAsync(true); await LockAsync(true);