Skip to content

Commit

Permalink
address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Nov 17, 2020
1 parent 02ab502 commit 8e1ce3d
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ export const TagManagementPage: FC<TagManagementPageParams> = ({
if (confirmed) {
await tagClient.delete(tag.id);

fetchTags();

notifications.toasts.addSuccess({
title: i18n.translate('xpack.savedObjectsTagging.notifications.deleteTagSuccessTitle', {
defaultMessage: 'Deleted "{name}" tag',
Expand All @@ -173,6 +171,8 @@ export const TagManagementPage: FC<TagManagementPageParams> = ({
},
}),
});

await fetchTags();
}
},
[overlays, notifications, fetchTags, tagClient]
Expand All @@ -182,17 +182,18 @@ export const TagManagementPage: FC<TagManagementPageParams> = ({
async (action: TagBulkAction) => {
try {
await action.execute(selectedTags.map(({ id }) => id));
if (action.refreshAfterExecute) {
await fetchTags();
}
} catch (e) {
notifications.toasts.addError(e, {
title: i18n.translate('xpack.savedObjectsTagging.notifications.bulkActionError', {
defaultMessage: 'An error occurred',
}),
});
} finally {
setLoading(false);
}
if (action.refreshAfterExecute) {
await fetchTags();
}
setLoading(false);
},
[selectedTags, fetchTags, notifications]
);
Expand Down

0 comments on commit 8e1ce3d

Please sign in to comment.