mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
fix: invalid cast in importing proxy_switch
This commit is contained in:
parent
1c0925a178
commit
0b283f5631
1 changed files with 7 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
using System.Diagnostics;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
using NodaTime;
|
using NodaTime;
|
||||||
|
|
@ -150,7 +151,12 @@ public class SystemConfigPatch: PatchObject
|
||||||
patch.HidDisplayCaps = o.Value<bool>("hid_display_caps");
|
patch.HidDisplayCaps = o.Value<bool>("hid_display_caps");
|
||||||
|
|
||||||
if (o.ContainsKey("proxy_switch"))
|
if (o.ContainsKey("proxy_switch"))
|
||||||
patch.ProxySwitch = o.Value<SystemConfig.ProxySwitchAction>("proxy_switch");
|
patch.ProxySwitch = o.Value<string>("proxy_switch") switch
|
||||||
|
{
|
||||||
|
"new" => SystemConfig.ProxySwitchAction.New,
|
||||||
|
"add" => SystemConfig.ProxySwitchAction.Add,
|
||||||
|
_ => SystemConfig.ProxySwitchAction.Off,
|
||||||
|
};
|
||||||
|
|
||||||
if (o.ContainsKey("name_format"))
|
if (o.ContainsKey("name_format"))
|
||||||
patch.NameFormat = o.Value<string>("name_format");
|
patch.NameFormat = o.Value<string>("name_format");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue