From 0ac06f8e3dce63253dba499ff610619a472faf0e Mon Sep 17 00:00:00 2001 From: Gabe Yuan Date: Mon, 4 Sep 2023 17:04:28 +0800 Subject: [PATCH] use new rules link --- .env | 5 +++-- src/config/index.js | 6 +++++- src/config/rules.js | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 7efcbe9..5c301b1 100644 --- a/.env +++ b/.env @@ -13,8 +13,9 @@ REACT_APP_OPTIONSPAGE_DEV=http://localhost:3000/options.html REACT_APP_LOGOURL=https://fishjar.github.io/kiss-translator/images/logo192.png REACT_APP_LOGOURL2=https://kiss-translator.rayjar.com/images/logo192.png -REACT_APP_RULESURL=https://fishjar.github.io/kiss-translator/kiss-translator-rules.json -REACT_APP_RULESURL2=https://kiss-translator.rayjar.com/kiss-translator-rules.json +REACT_APP_RULESURL=https://fishjar.github.io/kiss-rules/kiss-rules.json +REACT_APP_RULESURL_ON=https://fishjar.github.io/kiss-rules/kiss-rules-on.json +REACT_APP_RULESURL_OFF=https://fishjar.github.io/kiss-rules/kiss-rules-off.json REACT_APP_VERSIONFILE=https://fishjar.github.io/kiss-translator/version.txt REACT_APP_VERSIONFILE2=https://kiss-translator.rayjar.com/version.txt diff --git a/src/config/index.js b/src/config/index.js index b3133bc..540ff02 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -183,10 +183,14 @@ export const GLOBLA_RULE = { export const DEFAULT_SUBRULES_LIST = [ { url: process.env.REACT_APP_RULESURL, + selected: false, + }, + { + url: process.env.REACT_APP_RULESURL_ON, selected: true, }, { - url: process.env.REACT_APP_RULESURL2, + url: process.env.REACT_APP_RULESURL_OFF, selected: false, }, ]; diff --git a/src/config/rules.js b/src/config/rules.js index 12f03b9..9378a4e 100644 --- a/src/config/rules.js +++ b/src/config/rules.js @@ -177,7 +177,9 @@ const RULES = [ }, ]; -export const BUILTIN_RULES = RULES.map((item) => ({ +export const BUILTIN_RULES = RULES.sort((a, b) => + a.pattern.localeCompare(b.pattern) +).map((item) => ({ ...DEFAULT_RULE, ...item, transOpen: "true",