Browse Source

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

David Bejanyan 2 năm trước cách đây
mục cha
commit
ab9d0e2b3f
1 tập tin đã thay đổi với 8 bổ sung2 xóa
  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>
   );
 };