1
0
mirror of https://github.com/bitwarden/mobile.git synced 2024-07-02 11:34:54 +02:00

fixes to PreferencesStorageService

This commit is contained in:
Kyle Spearrin 2019-03-28 14:09:33 -04:00
parent 9042702c09
commit 364f25e22a

View File

@ -6,7 +6,7 @@ namespace Bit.Core.Services
{ {
public class PreferencesStorageService : IStorageService public class PreferencesStorageService : IStorageService
{ {
private string _keyFormat = "bwPref:{0}"; private string _keyFormat = "bwPreferencesStorage:{0}";
public Task<T> GetAsync<T>(string key) public Task<T> GetAsync<T>(string key)
{ {
@ -50,12 +50,12 @@ namespace Bit.Core.Services
public Task SaveAsync<T>(string key, T obj) public Task SaveAsync<T>(string key, T obj)
{ {
var formattedKey = string.Format(_keyFormat, key);
if(obj == null) if(obj == null)
{ {
return RemoveAsync(formattedKey); return RemoveAsync(key);
} }
var formattedKey = string.Format(_keyFormat, key);
var objType = typeof(T); var objType = typeof(T);
if(objType == typeof(string)) if(objType == typeof(string))
{ {