Skip to content

Commit

Permalink
fix: default drop down value (#741)
Browse files Browse the repository at this point in the history
  • Loading branch information
alonkeyval authored Nov 5, 2023
1 parent 8acb372 commit de3daf7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/webapp/containers/setup/sources/sources.section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const DEFAULT_CONFIG = {
future_selected: false,
};

const DEFAULT = 'default';

export function SourcesSection({ sectionData, setSectionData }: any) {
const [currentNamespace, setCurrentNamespace] = useState<any>(null);
const [searchFilter, setSearchFilter] = useState<string>('');
Expand All @@ -22,7 +24,12 @@ export function SourcesSection({ sectionData, setSectionData }: any) {
);

useEffect(() => {
!currentNamespace && data && setCurrentNamespace(data?.namespaces[0]);
if (!currentNamespace && data) {
const currentNamespace = data?.namespaces.find(
(item: any) => item.name === DEFAULT
);
setCurrentNamespace(currentNamespace);
}
}, [data]);

useEffect(() => {
Expand Down

0 comments on commit de3daf7

Please sign in to comment.