refactor: Refactor the arguments of the Flag Operator

This commit is contained in:
Peng-YM
2022-07-06 18:06:49 +08:00
parent acd0a62496
commit a420c126c2
6 changed files with 20 additions and 13 deletions

View File

@@ -104,12 +104,12 @@ function QuickSettingOperator(args) {
}
// add or remove flag for proxies
function FlagOperator(add = true) {
function FlagOperator({ mode }) {
return {
name: 'Flag Operator',
func: (proxies) => {
return proxies.map((proxy) => {
if (!add) {
if (mode === 'remove') {
// no flag
proxy.name = removeFlag(proxy.name);
} else {