A music player that connects to your cloud/distributed storage.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: ignore non-semver versions

+8 -4
+8 -4
src/common/pages/version-upgrade.js
··· 1 - import { greaterThan, parse as parseSemver } from "@std/semver"; 1 + import { canParse, greaterThan, parse as parseSemver } from "@std/semver"; 2 2 3 3 // Version upgrade (only works with `diffuse-artifacts` deployments) 4 - if (true || document.location.hostname.endsWith("diffuse.sh")) { 4 + if (document.location.hostname.endsWith("diffuse.sh")) { 5 5 document.querySelectorAll("#status").forEach(async (status) => { 6 6 const versionOrCid = 7 7 document.location.pathname.slice(1).split("/")[0]?.toLowerCase() ?? ""; ··· 11 11 { with: { type: "json" } } 12 12 ).catch(() => ({ default: {} })); 13 13 14 - // Latest by semver 14 + // Latest by semver (ignore non-semver versions) 15 15 const lastArtifact = Object.values(artifacts).reduce((max, artifact) => { 16 + if (!canParse(artifact.version)) return max; 16 17 if (!max) return artifact; 17 - return greaterThan(parseSemver(artifact.version), parseSemver(max.version)) 18 + return greaterThan( 19 + parseSemver(artifact.version), 20 + parseSemver(max.version), 21 + ) 18 22 ? artifact 19 23 : max; 20 24 }, null);