From 21d44105ebac3488944f05d250d2a8ac55ce9184 Mon Sep 17 00:00:00 2001 From: Nastya Rusina Date: Fri, 13 May 2022 15:56:11 -0700 Subject: [PATCH] fix: ensure that admin version is fully shown Signed-off-by: Nastya Rusina --- packages/zapp/console/src/components/hooks/useVersion.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/zapp/console/src/components/hooks/useVersion.ts b/packages/zapp/console/src/components/hooks/useVersion.ts index cb7aee5bf..59aca5c06 100644 --- a/packages/zapp/console/src/components/hooks/useVersion.ts +++ b/packages/zapp/console/src/components/hooks/useVersion.ts @@ -16,10 +16,10 @@ function useVersion() { export function useAdminVersion() { const version = useVersion(); - const controlPlaneVersion = version?.value?.controlPlaneVersion; - const adminVersion = controlPlaneVersion - ? controlPlaneVersion.Version?.slice(1, controlPlaneVersion.Version?.indexOf('-')) - : null; + const cpVersion = version?.value?.controlPlaneVersion; + + // Remove letter "v" from version string, if it's in the beginning + const adminVersion = cpVersion?.Version?.replace(/^v/, '') ?? null; return { adminVersion }; }