mirror of
https://github.com/YuJunZhiXue/dsh-purge.git
synced 2026-11-28 11:40:22 +08:00
fix: 发布 1.1.30,切换版本改为自行下载,并去掉提示词死循环
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
df25a90b0d
commit
181fe141e3
5 files changed
+403
-271
No files matched your search
@@ -892,7 +892,7 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
const next = { stable: "", beta: "" };
|
||||
for (const id of ["stable", "beta"]) {
|
||||
const list = versions.filter((item) => item.channel === id && keepListedVersion(item, ceiling));
|
||||
const hit = preferListed(list, d && d.localVersion);
|
||||
const hit = preferListed(list, d && d.localVersion, d && d.pin);
|
||||
next[id] = (hit && hit.ref) || "";
|
||||
}
|
||||
setPick(next);
|
||||
@@ -1279,7 +1279,7 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
const ceiling = listedCeiling(versions, localVer || (updateInfo && updateInfo.localVersion));
|
||||
const list = versions.filter((item) => item.channel === id && keepListedVersion(item, ceiling));
|
||||
const selectedRef = pick[id] || "";
|
||||
const hit = list.find((item) => item.ref === selectedRef) || preferListed(list, localVer);
|
||||
const hit = list.find((item) => item.ref === selectedRef) || preferListed(list, localVer, updateInfo && updateInfo.pin);
|
||||
const onLane = channelNow === id;
|
||||
const noBeta = id === "beta" && Array.isArray(updateInfo && updateInfo.versions) && !list.length;
|
||||
const pickedOther = Boolean(hit && selectedRef && !hit.current);
|
||||
@@ -1721,7 +1721,9 @@ window.__ModuleLoader__.load({ id: "dsh-purge", factory: (require) => {
|
||||
return listedVersionNewer(ver, ceiling);
|
||||
}
|
||||
|
||||
function preferListed(list, localVer) {
|
||||
function preferListed(list, localVer, pin) {
|
||||
const pinned = pin ? (list || []).find((item) => item.ref === pin) : null;
|
||||
if (pinned) return pinned;
|
||||
const ver = String(localVer || "").replace(/^v/i, "");
|
||||
return (list || []).find((item) => item.current)
|
||||
|| (list || []).find((item) => ver && String(item.version || "").replace(/^v/i, "") === ver)
|
||||
|
||||
Reference in new issue
Block a user