mirror of
https://gitea.redwind.top/Austin/subscription
synced 2024-11-16 06:22:20 +08:00
feat: order
This commit is contained in:
parent
b604e7c8ac
commit
dcd0623766
|
@ -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',
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user