MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / updateRecord

Function updateRecord

src/pages/batchupdate/App.tsx:82–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80 };
81
82 const updateRecord = () => {
83 getBatchUpdateRecord().then((batchUpdateRecordObjectLite) => {
84 const list = batchUpdateRecordObjectLite?.list || [];
85 const site = [] as TBatchUpdateRecord[];
86 const other = [] as TBatchUpdateRecord[];
87 const ignored = [] as TBatchUpdateRecord[];
88 for (const entry of list) {
89 if (!entry.checkUpdate) {
90 site.push(entry);
91 continue;
92 }
93 const newVersion = entry.newMeta?.version?.[0];
94 const isIgnored = typeof newVersion === "string" && entry.script.ignoreVersion === newVersion;
95 const mEntry = {
96 ...entry,
97 };
98
99 if (isIgnored) {
100 ignored.push(mEntry);
101 } else {
102 if (!paramSite || mEntry.sites?.includes(paramSite)) {
103 site.push(mEntry);
104 } else {
105 other.push(mEntry);
106 }
107 }
108 }
109 setRecords({ site, other, ignored });
110 });
111 };
112
113 const onScriptUpdateCheck = (data: any) => {
114 if (

Callers 1

onScriptUpdateCheckFunction · 0.85

Calls 2

getBatchUpdateRecordFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected