mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-01 01:10:21 +08:00
fix: only show plugin update for newer market versions
Only mark installed plugins as updatable when the marketplace version is a known newer version, including pre-release-to-stable transitions. Conflict resolution also keeps per-plugin marketplace source lookup from current master.
This commit is contained in:
@@ -751,10 +751,23 @@ export const useExtensionPage = () => {
|
||||
}
|
||||
|
||||
extension.update_market_plugin = matchedPlugin;
|
||||
extension.online_version = matchedPlugin.version;
|
||||
const localVersion = String(extension.version || "").trim();
|
||||
const onlineVersion = String(matchedPlugin.version || "").trim();
|
||||
const isKnownVersion =
|
||||
/^v?\d+/.test(localVersion) &&
|
||||
/^v?\d+/.test(onlineVersion) &&
|
||||
onlineVersion !== tm("status.unknown");
|
||||
const versionCompare = isKnownVersion
|
||||
? compareVersions(localVersion, onlineVersion)
|
||||
: 0;
|
||||
|
||||
extension.online_version = onlineVersion;
|
||||
extension.has_update =
|
||||
extension.version !== matchedPlugin.version &&
|
||||
matchedPlugin.version !== tm("status.unknown");
|
||||
isKnownVersion &&
|
||||
(versionCompare < 0 ||
|
||||
(versionCompare === 0 &&
|
||||
localVersion.includes("-") &&
|
||||
!onlineVersion.includes("-")));
|
||||
});
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user