From 04ad15fdccaea2bb134d455621428c3d1889e5dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksa=20Siri=C5=A1ki?= <31509435+aleksasiriski@users.noreply.github.com> Date: Sun, 25 Aug 2024 13:27:41 +0200 Subject: [PATCH] fix(versions): better extract func and apply to frontend as well --- src/routes/+layout.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/+layout.js b/src/routes/+layout.js index 31b36686..5b77e542 100644 --- a/src/routes/+layout.js +++ b/src/routes/+layout.js @@ -5,7 +5,7 @@ import { fetchVersion } from '$lib/functions/api/fetchversion'; export async function load({ fetch }) { const apiVersion = await fetchVersion(fetch); return { - uiVersion: PUBLIC_UI_VERSION ?? 'dev', + uiVersion: extractVersion(PUBLIC_UI_VERSION) ?? 'dev', apiVersion: extractVersion(apiVersion) ?? 'dev' }; } @@ -16,7 +16,7 @@ export async function load({ fetch }) { */ function extractVersion(input) { // Regular expression to match the version part - const versionRegex = /^v\d+\.\d+\.\d+/; + const versionRegex = /v\d+\.\d+\.\d+(-preview)?/; const match = input.match(versionRegex); // Return the matched version or null if not found