Skip to content

Commit

Permalink
Refactor to always hide modal
Browse files Browse the repository at this point in the history
The delete confirm modal would still be visible on error. This always hides the modal
  • Loading branch information
scottybollinger committed Dec 3, 2021
1 parent e52e145 commit c6c06f3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,13 @@ export const ApiKeysLogic = kea<MakeLogicType<ApiKeysLogicValues, ApiKeysLogicAc
{
showDeleteModal: () => true,
hideDeleteModal: () => false,
fetchApiKeys: () => false,
},
],
apiTokenNameToDelete: [
'',
{
showDeleteModal: (_, tokenName) => tokenName,
hideDeleteModal: () => '',
fetchApiKeys: () => '',
},
],
formErrors: [
Expand Down Expand Up @@ -189,6 +187,8 @@ export const ApiKeysLogic = kea<MakeLogicType<ApiKeysLogicValues, ApiKeysLogicAc
flashSuccessToast(DELETE_MESSAGE(apiTokenNameToDelete));
} catch (e) {
flashAPIErrors(e);
} finally {
actions.hideDeleteModal();
}
},
onApiFormSubmit: async () => {
Expand Down

0 comments on commit c6c06f3

Please sign in to comment.