1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-11-23 11:45:38 +01:00

task.run init

This commit is contained in:
Kyle Spearrin 2019-04-26 10:54:02 -04:00
parent fb50123af0
commit 1b613db534

View File

@ -32,21 +32,18 @@ namespace Bit.Core.Services
{
return _initTask;
}
Task doTask()
_initTask = Task.Run(() =>
{
try
{
var db = new LiteDatabase($"Filename={_dbPath};");
_collection = db.GetCollection<JsonItem>("json_items");
return Task.FromResult(0);
}
finally
{
_initTask = null;
}
};
_initTask = doTask();
});
return _initTask;
}