From a25a3a2cc3e43ffbe487f5240343d2fc2a41b6e2 Mon Sep 17 00:00:00 2001 From: NobyDa <53217160+NobyDa@users.noreply.github.com> Date: Sun, 16 May 2021 12:17:01 +0800 Subject: [PATCH] fix loon new version issues. --- Shortcuts/PolicySwitch.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Shortcuts/PolicySwitch.js b/Shortcuts/PolicySwitch.js index 46885bf..05c41fa 100644 --- a/Shortcuts/PolicySwitch.js +++ b/Shortcuts/PolicySwitch.js @@ -72,8 +72,12 @@ function nobyda() { }) } if (isLoon) { - const get = JSON.parse($config.getSubPolicys(groupName)); - return get.map(n => n[0].name); + return new Promise((resolve) => { + $config.getSubPolicys(groupName, (b) => { + const get = JSON.parse(b || '[]').map(n => n.name); + resolve(get) + }) + }) } if (isQuanX) { return new Promise((resolve) => {