show subrule sync time

This commit is contained in:
Gabe Yuan
2023-09-08 15:16:10 +08:00
parent 56350de2cf
commit d48296046e
3 changed files with 39 additions and 2 deletions

View File

@@ -4,6 +4,7 @@ import {
updateSync,
setSubRules,
getSubRules,
updateSetting,
} from "./storage";
import { apiFetchRules } from "../apis";
import { checkRules } from "./rules";
@@ -54,6 +55,10 @@ export const trySyncAllSubRules = async ({ subrulesList }, isBg = false) => {
await syncAllSubRules(subrulesList, isBg);
await updateSync({ subRulesSyncAt: now });
}
subrulesList.forEach((item) => {
item.syncAt = now;
});
await updateSetting({ subrulesList });
} catch (err) {
console.log("[try sync all subrules]", err);
}