Skip to content

Commit

Permalink
fix delete s3 data source issue
Browse files Browse the repository at this point in the history
Signed-off-by: Eric <[email protected]>
  • Loading branch information
mengweieric committed Apr 30, 2024
1 parent 24707c6 commit 1e7fdc1
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const getMatchedOption = (
dataSourceName: string,
dataSourceType: string
) => {
if (!dataSourceName || !dataSourceType) return [];
for (const dsGroup of dataSourceList) {
const matchedOption = dsGroup.options.find(
(item) => item.type === dataSourceType && item.name === dataSourceName
Expand All @@ -118,8 +119,8 @@ export const DataSourceSelection = ({ tabId }: { tabId: string }) => {
const [selectedSources, setSelectedSources] = useState<SelectedDataSource[]>(
getMatchedOption(
dataSourceOptionList,
explorerSearchMetadata.datasources[0].name,
explorerSearchMetadata.datasources[0].type
explorerSearchMetadata.datasources?.[0]?.name || '',
explorerSearchMetadata.datasources?.[0]?.type || ''
)
);

Expand Down Expand Up @@ -173,8 +174,8 @@ export const DataSourceSelection = ({ tabId }: { tabId: string }) => {
setSelectedSources(
getMatchedOption(
memorizedDataSourceOptionList,
explorerSearchMetadata.datasources[0].name,
explorerSearchMetadata.datasources[0].type
explorerSearchMetadata.datasources?.[0]?.name || '',
explorerSearchMetadata.datasources?.[0]?.type || ''
)
);
}, [explorerSearchMetadata.datasources, dataSourceOptionList]);
Expand Down

0 comments on commit 1e7fdc1

Please sign in to comment.