浏览代码

checking if version equals versionTag and show it

davitbejanyan 2 年之前
父节点
当前提交
aec33f254a
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      kafka-ui-react-app/src/components/Version/Version.tsx

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

@@ -8,9 +8,13 @@ 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 = version?.match(versionTag)
+    ? versionTag
+    : formatTimestamp(buildTime);
   return (
     <S.Wrapper>
       {!isLatestRelease && (
@@ -32,7 +36,7 @@ const Version: React.FC = () => {
           </S.CurrentCommitLink>
         </div>
       )}
-      <S.CurrentVersion>{formatTimestamp(buildTime)}</S.CurrentVersion>
+      <S.CurrentVersion>{currentVersion}</S.CurrentVersion>
     </S.Wrapper>
   );
 };