Skip to content

Commit

Permalink
fix(database-modal): Refresh Data when importing (#20523)
Browse files Browse the repository at this point in the history
* Database Modal:

- Add missing invocation to onDatabaseAdd after importing DB from file
- Add keys to our IconButtons

* Database Modal:

- Reduce if clause so it's more concise
  • Loading branch information
Antonio-RiveroMartnez authored Jun 28, 2022
1 parent 93fbfe9 commit 850f5fa
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
onClick={() => setDatabaseModel(database.name)}
buttonText={database.name}
icon={dbImages?.[database.engine]}
key={`${database.name}`}
/>
))}
</div>
Expand Down Expand Up @@ -973,11 +974,12 @@ const DatabaseModal: FunctionComponent<DatabaseModalProps> = ({
]);

if (!(info.file.originFileObj instanceof File)) return;
await importResource(
const dbId = await importResource(
info.file.originFileObj,
passwords,
confirmedOverwrite,
);
if (dbId) onDatabaseAdd?.();
};

const passwordNeededField = () => {
Expand Down

0 comments on commit 850f5fa

Please sign in to comment.