mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Update to the Settings interface.
- Methods are now suffixed async - Extension methods moved to the actual class and class renamed from SettingValue to Setting - "Helpers" renamed to "SettingsProvider" - Removed the ghetto CSV list method. Only setting using it was Pusher Channels which was orphaned by the new Kick channel feature. The call to ToList in the Chips.gg integration was incorrect and just proves lists should be consistently based around JSON objects instead of randomly string splitting
This commit is contained in:
@@ -21,7 +21,7 @@ public class KfTokenService
|
||||
_kiwiFlare = new KiwiFlare(kfDomain, proxy, cancellationToken);
|
||||
_proxy = proxy;
|
||||
_kfDomain = kfDomain;
|
||||
var cachedCookies = Helpers.GetValue(BuiltIn.Keys.KiwiFarmsCookies).Result
|
||||
var cachedCookies = SettingsProvider.GetValueAsync(BuiltIn.Keys.KiwiFarmsCookies).Result
|
||||
.JsonDeserialize<Dictionary<string, string>>();
|
||||
// This shouldn't happen as the setting's default value is {}, but I'm just doing it to shut the IDE up
|
||||
if (cachedCookies == null) return;
|
||||
@@ -161,7 +161,7 @@ public class KfTokenService
|
||||
{
|
||||
_logger.Debug("Saving cookies");
|
||||
var cookiesToSave = _cookies.GetAllCookies().ToDictionary(cookie => cookie.Name, cookie => cookie.Value);
|
||||
await Helpers.SetValueAsJsonObject(BuiltIn.Keys.KiwiFarmsCookies, cookiesToSave);
|
||||
await SettingsProvider.SetValueAsJsonObjectAsync(BuiltIn.Keys.KiwiFarmsCookies, cookiesToSave);
|
||||
}
|
||||
|
||||
public void WipeCookies()
|
||||
|
||||
Reference in New Issue
Block a user