mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 05:26:47 +00:00
fix(notices): hand the release notice only to a bundle built for the running version
After an update the service worker keeps serving the previous bundle until the new one is installed. That shell announces the release layout too, so the layout alone let it draw the notice with its own older texts and use it up for the version now running with one click on X. The bundle now sends the version it was built as (client/package.json, baked in by define), and the server compares it with its own before it hands a notice with a release block over. A shell of another version is told nothing and gets the notice after the reload, from the bundle that can draw it. This holds for every update, not only the one that introduced the parameter.
This commit is contained in:
@@ -5,7 +5,7 @@ import { SYSTEM_NOTICES } from './registry.js';
|
||||
import { evaluate } from './conditions.js';
|
||||
import type { SystemNotice, SystemNoticeDTO } from './types.js';
|
||||
|
||||
function getCurrentAppVersion(): string {
|
||||
export function getCurrentAppVersion(): string {
|
||||
const fromEnv = semver.valid(readEnv().app.appVersion ?? '');
|
||||
if (fromEnv) return fromEnv;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user