Browse Source

Seek type field became empty with refreshing the page (#2863)

* Seek type field became empty with refreshing the page (#2857)

* Seek type field became empty with refreshing the page (#2857)

Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
Winnie Chiu 2 years ago
parent
commit
8bb9f63658

+ 5 - 1
kafka-ui-react-app/src/components/Topics/Topic/Messages/Filters/Filters.tsx

@@ -109,7 +109,11 @@ const Filters: React.FC<FiltersProps> = ({
   );
 
   const [currentSeekType, setCurrentSeekType] = React.useState<SeekType>(
-    (searchParams.get('seekType') as SeekType) || SeekType.OFFSET
+    SeekTypeOptions.find(
+      (ele) => ele.value === (searchParams.get('seekType') as SeekType)
+    ) !== undefined
+      ? (searchParams.get('seekType') as SeekType)
+      : SeekType.OFFSET
   );
   const [offset, setOffset] = React.useState<string>(
     getOffsetFromSeekToParam(searchParams)