diff options
| author | Maze Winther <mazewinther@gmail.com> | 2026-04-15 02:13:42 +0200 |
|---|---|---|
| committer | Maze Winther <mazewinther@gmail.com> | 2026-04-15 02:13:42 +0200 |
| commit | 3914ea9b71da50620a53a8520db1830d946b7ee9 (patch) | |
| tree | 904e7118e7f266d52bb2daf4b249ba53b579368d /apps | |
| parent | 370944f443cb997ef71dda0c8ef6f4e92bea87d7 (diff) | |
| download | opencut-3914ea9b71da50620a53a8520db1830d946b7ee9.tar.gz | |
fix: show changelog notice when stored version is missing or older
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/web/src/lib/changelog/components/changelog-notification.tsx | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/apps/web/src/lib/changelog/components/changelog-notification.tsx b/apps/web/src/lib/changelog/components/changelog-notification.tsx index c45eaaac..4433df30 100644 --- a/apps/web/src/lib/changelog/components/changelog-notification.tsx +++ b/apps/web/src/lib/changelog/components/changelog-notification.tsx @@ -25,20 +25,17 @@ export function ChangelogNotification() { // localStorage unavailable } - // First-time visitor: record the version silently, nothing to announce. - if (storedVersion === null) { - try { - localStorage.setItem(STORAGE_KEY, latest.version); - } catch { - // ignore - } - return; - } + const isOutdated = + storedVersion === null || + storedVersion.localeCompare(latest.version, undefined, { + numeric: true, + }) < 0; - // Already seen this version. - if (storedVersion === latest.version) return; + // TODO(v0.4): revert to the standard "null = first-time visitor, record silently" + // path. The null case intentionally shows the card for this release so existing + // users who never had the key get the 0.3.0 announcement. + if (!isOutdated) return; - // New version since last visit: record it and show the notification. try { localStorage.setItem(STORAGE_KEY, latest.version); } catch { |
