Skip to content

Commit

Permalink
fix: use compare package to compare versions
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Oct 8, 2024
1 parent 71183a1 commit 4c7486b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"canvas-confetti": "^1.9.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"compare-versions": "^6.1.1",
"date-fns": "^3.6.0",
"dayjs": "^1.11.10",
"embla-carousel-react": "^8.0.2",
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/layouts/AppLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { compare } from "compare-versions";
import {
Cable,
Cloud,
Expand Down Expand Up @@ -327,7 +328,7 @@ function AppVersion() {
const upToDate =
info.version &&
info.version.startsWith("v") &&
info.version.substring(1) >= albyInfo.hub.latestVersion;
compare(info.version.substring(1), albyInfo.hub.latestVersion, ">=");

return (
<TooltipProvider>
Expand Down
5 changes: 5 additions & 0 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3095,6 +3095,11 @@ compare-func@^2.0.0:
array-ify "^1.0.0"
dot-prop "^5.1.0"

compare-versions@^6.1.1:
version "6.1.1"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-6.1.1.tgz#7af3cc1099ba37d244b3145a9af5201b629148a9"
integrity sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==

[email protected]:
version "0.0.1"
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
Expand Down

0 comments on commit 4c7486b

Please sign in to comment.