瀏覽代碼

FE: Fix version display with a tag (#3827)

David Bejanyan 2 年之前
父節點
當前提交
ab9d0e2b3f
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      kafka-ui-react-app/src/components/Version/Version.tsx

+ 8 - 2
kafka-ui-react-app/src/components/Version/Version.tsx

@@ -8,9 +8,15 @@ import * as S from './Version.styled';
 
 const Version: React.FC = () => {
   const { data: latestVersionInfo = {} } = useLatestVersion();
-  const { buildTime, commitId, isLatestRelease } = latestVersionInfo.build;
+  const { buildTime, commitId, isLatestRelease, version } =
+    latestVersionInfo.build;
   const { versionTag } = latestVersionInfo?.latestRelease || '';
 
+  const currentVersion =
+    isLatestRelease && version?.match(versionTag)
+      ? versionTag
+      : formatTimestamp(buildTime);
+
   return (
     <S.Wrapper>
       {!isLatestRelease && (
@@ -34,7 +40,7 @@ const Version: React.FC = () => {
           </S.CurrentCommitLink>
         </div>
       )}
-      <S.CurrentVersion>{formatTimestamp(buildTime)}</S.CurrentVersion>
+      <S.CurrentVersion>{currentVersion}</S.CurrentVersion>
     </S.Wrapper>
   );
 };