From c7ac69e8dcd9b704b6558ea16021da555dee59dd Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Fri, 7 Jun 2024 14:03:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyPublic.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SrcJyPublic.js b/SrcJyPublic.js index 6229f76c..81727916 100644 --- a/SrcJyPublic.js +++ b/SrcJyPublic.js @@ -169,6 +169,7 @@ function selectSource() { const hikerPop = $.require("http://hiker.nokia.press/hikerule/rulelist.json?id=6966"); let sourceAllList = getDatas("jk", 1); let sourceList = getGroupLists(sourceAllList, sourceGroup); + let tmpList = sourceList; hikerPop.setUseStartActivity(false); let index = 0; @@ -194,6 +195,7 @@ function selectSource() { onChange(s, manage) { //log("onChange:"+s); let flist = names.filter(x => x.includes(s)); + tmpList = sourceList.filter(x => x.name.includes(s)); manage.list.length = 0; flist.forEach(x => { manage.list.push(x); @@ -223,8 +225,8 @@ function selectSource() { pop.dismiss(); let input = s.replace(/[’‘]/g, ""); - if(sourceList[i].name==s){ - Juconfig["homeSource"] = sourceList[i]; + if(tmpList[i].name==s){ + Juconfig["homeSource"] = tmpList[i]; writeFile(cfgfile, JSON.stringify(Juconfig)); refreshPage(false); return 'toast://' + '主页源已设置为:' + input; @@ -244,7 +246,6 @@ function selectSource() { manage.scrollToPosition(index, false); } else if (i === 2) { manage.list.reverse(); - names.reverse(); manage.change(); manage.scrollToPosition(index, true); }