From 0dce6a98a917b17b29de080573c94f77582e9864 Mon Sep 17 00:00:00 2001 From: retrozinndev Date: Wed, 25 Jun 2025 22:04:22 -0300 Subject: [PATCH] :boom: fix(scripts/config): unwanted _getProperty recursion --- ags/scripts/config.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ags/scripts/config.ts b/ags/scripts/config.ts index 7fe290b..1d897ac 100644 --- a/ags/scripts/config.ts +++ b/ags/scripts/config.ts @@ -38,7 +38,7 @@ export type ConfigEntries = Partial<{ }>; }>; -type ValueTypes = "string" | "boolean" | "object" | "integer" | "undefined" | "any"; +type ValueTypes = "string" | "boolean" | "object" | "number" | "undefined" | "any"; @register({ GTypeName: "Config" }) @@ -52,8 +52,8 @@ class Config extends GObject.Object implements Subscribable { * in the `entries` field */ public readonly defaults: ConfigEntries = { notifications: { - timeout_low: 2000, - timeout_normal: 5000, + timeout_low: 4000, + timeout_normal: 6000, timeout_critical: 0 }, @@ -218,7 +218,13 @@ class Config extends GObject.Object implements Subscribable { }\` is either \`undefined\` or not in the expected value type \`${expectType }\`, returning default value`); - property = this.getPropertyDefault(path); + property = this.defaults; + + for(let i = 0; i < pathArray.length; i++) { + const currentPath = pathArray[i]; + + property = property[currentPath as keyof typeof property]; + } } if(expectType !== "any" && typeof property !== expectType) {