feat: order

This commit is contained in:
lisonge 2024-01-29 11:01:55 +08:00
parent b604e7c8ac
commit dcd0623766
3 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
import apps from './rawApps'; import apps from './rawApps';
import type { RawGlobalGroup } from './types'; import type { RawGlobalGroup } from './types';
import { OPEN_AD_ORDER } from './utils';
const diabledAppIds = [ const diabledAppIds = [
'com.android.systemui', // 通知栏界面 'com.android.systemui', // 通知栏界面
@ -31,7 +32,7 @@ const globalGroups: RawGlobalGroup[] = [
{ {
key: 0, key: 0,
name: '开屏广告', name: '开屏广告',
order: -1, order: OPEN_AD_ORDER,
actionMaximum: 2, actionMaximum: 2,
matchTime: 10000, matchTime: 10000,
resetMatch: 'app', resetMatch: 'app',

View File

@ -5,6 +5,7 @@ import picocolors from 'picocolors';
import { pinyin } from 'pinyin-pro'; import { pinyin } from 'pinyin-pro';
import { walk } from './file'; import { walk } from './file';
import type { RawApp } from './types'; import type { RawApp } from './types';
import { OPEN_AD_ORDER } from './utils';
const rawApps: RawApp[] = []; const rawApps: RawApp[] = [];
for await (const tsFp of walk(process.cwd() + '/src/apps')) { for await (const tsFp of walk(process.cwd() + '/src/apps')) {
@ -26,7 +27,7 @@ for await (const tsFp of walk(process.cwd() + '/src/apps')) {
if (!g.name.startsWith('开屏广告')) { if (!g.name.startsWith('开屏广告')) {
g.enable = false; g.enable = false;
} else { } else {
g.order = -1; g.order = OPEN_AD_ORDER;
} }
}); });
rawApps.push(appConfig); rawApps.push(appConfig);

View File

@ -5,3 +5,5 @@ export const tryRun = <T>(fc: () => T, fallbackFc: (e: unknown) => T) => {
return fallbackFc(e); return fallbackFc(e);
} }
}; };
export const OPEN_AD_ORDER = -10;