Skip to content

Commit

Permalink
AssistantBuilderDataSourceModal: return to list of datasource when cl… (
Browse files Browse the repository at this point in the history
#3411)

* AssistantBuilderDataSourceModal: return to list of datasource when closing selector

* nit
  • Loading branch information
spolu authored Jan 24, 2024
1 parent a6d84bb commit 68dde0b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ export default function AssistantBuilderDataSourceModal({
}
}, [dataSourceToManage]);

const onReset = () => {
setSelectedDataSource(null);
setSelectedResources({});
setIsSelectAll(false);
};

const onClose = () => {
setOpen(false);
setTimeout(() => {
setSelectedDataSource(null);
setSelectedResources({});
setIsSelectAll(false);
onReset();
}, 200);
};

Expand All @@ -77,7 +81,7 @@ export default function AssistantBuilderDataSourceModal({
return (
<Modal
isOpen={isOpen}
onClose={onClose}
onClose={selectedDataSource && !dataSourceToManage ? onReset : onClose}
onSave={() => onSaveLocal({ isSelectAll })}
hasChanged={
!!selectedDataSource &&
Expand Down

0 comments on commit 68dde0b

Please sign in to comment.