fix (product): cron-sync-artifacts not working

This commit is contained in:
Peng-YM 2022-07-13 14:03:40 +08:00
parent 03149dcadb
commit 9677c7ebbd
5 changed files with 18 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "sub-store", "name": "sub-store",
"version": "2.11.3", "version": "2.11.4",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -5,9 +5,14 @@ import $ from '@/core/app';
!(async function () { !(async function () {
const settings = $.read(SETTINGS_KEY); const settings = $.read(SETTINGS_KEY);
if (settings.enableCronSyncArtifacts === true) { // if GitHub token is not configured
await doSync(); if (!settings.githubUser || !settings.gistToken) return;
}
const artifacts = $.read(ARTIFACTS_KEY);
if (!artifacts || artifacts.length === 0) return;
const shouldSync = artifacts.some((artifact) => artifact.sync);
if (shouldSync) doSync();
})().finally(() => $.done()); })().finally(() => $.done());
async function doSync() { async function doSync() {

File diff suppressed because one or more lines are too long