mirror of
https://github.com/bitwarden/mobile
synced 2026-01-09 20:13:18 +00:00
themeing
This commit is contained in:
@@ -12,7 +12,17 @@ namespace Bit.App.Services
|
||||
|
||||
private readonly HashSet<string> _preferenceStorageKeys = new HashSet<string>
|
||||
{
|
||||
Constants.LockOptionKey
|
||||
Constants.LockOptionKey,
|
||||
Constants.ThemeKey,
|
||||
Constants.DefaultUriMatch,
|
||||
Constants.DisableAutoTotpCopyKey,
|
||||
Constants.DisableFaviconKey,
|
||||
Constants.ClearClipboardKey,
|
||||
Constants.AccessibilityAutofillPasswordFieldKey,
|
||||
Constants.AccessibilityAutofillPersistNotificationKey,
|
||||
Constants.LastActiveKey,
|
||||
Constants.PushInitialPromptShownKey,
|
||||
Constants.LastFileCacheClearKey
|
||||
};
|
||||
|
||||
public MobileStorageService(
|
||||
|
||||
@@ -8,7 +8,8 @@ namespace Bit.App.Services
|
||||
{
|
||||
public class PreferencesStorageService : IStorageService
|
||||
{
|
||||
private readonly string _keyFormat = "bwPreferencesStorage:{0}";
|
||||
public static string KeyFormat = "bwPreferencesStorage:{0}";
|
||||
|
||||
private readonly string _sharedName;
|
||||
private readonly JsonSerializerSettings _jsonSettings = new JsonSerializerSettings
|
||||
{
|
||||
@@ -22,7 +23,7 @@ namespace Bit.App.Services
|
||||
|
||||
public Task<T> GetAsync<T>(string key)
|
||||
{
|
||||
var formattedKey = string.Format(_keyFormat, key);
|
||||
var formattedKey = string.Format(KeyFormat, key);
|
||||
if(!Xamarin.Essentials.Preferences.ContainsKey(formattedKey, _sharedName))
|
||||
{
|
||||
return Task.FromResult(default(T));
|
||||
@@ -73,7 +74,7 @@ namespace Bit.App.Services
|
||||
return RemoveAsync(key);
|
||||
}
|
||||
|
||||
var formattedKey = string.Format(_keyFormat, key);
|
||||
var formattedKey = string.Format(KeyFormat, key);
|
||||
var objType = typeof(T);
|
||||
if(objType == typeof(string))
|
||||
{
|
||||
@@ -109,7 +110,7 @@ namespace Bit.App.Services
|
||||
|
||||
public Task RemoveAsync(string key)
|
||||
{
|
||||
var formattedKey = string.Format(_keyFormat, key);
|
||||
var formattedKey = string.Format(KeyFormat, key);
|
||||
if(Xamarin.Essentials.Preferences.ContainsKey(formattedKey, _sharedName))
|
||||
{
|
||||
Xamarin.Essentials.Preferences.Remove(formattedKey, _sharedName);
|
||||
|
||||
Reference in New Issue
Block a user