Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Mar 19, 2020
1 parent 237d7f8 commit b1465a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ export const GenericDownloaderComponent = ({

const exportData = async () => {
if (anchorRef && anchorRef.current && ids != null && ids.length > 0) {
let exportResponse;
try {
exportResponse = await exportSelectedData({
const exportResponse = await exportSelectedData({
ids,
signal: abortCtrl.signal,
});
Expand All @@ -81,7 +80,9 @@ export const GenericDownloaderComponent = ({
}
} catch (error) {
if (isSubscribed) {
if (onExportFailure != null) onExportFailure();
if (onExportFailure != null) {
onExportFailure();
}
errorToToaster({ title: i18n.EXPORT_FAILURE, error, dispatchToaster });
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,3 @@ export const DeleteTimelineModal = React.memo<Props>(({ title, closeModal, onDel
));

DeleteTimelineModal.displayName = 'DeleteTimelineModal';

export const useDeleteTimelineModal = () => {
const [isDeleteTimelineModalOpen, setIsDeleteTimelineModalOpen] = useState<boolean>(false);

const onCloseDeleteTimelineModal = useCallback(() => {
setIsDeleteTimelineModalOpen(false);
}, []);

const onOpenDeleteTimelineModal = useCallback(() => {
setIsDeleteTimelineModalOpen(true);
}, []);
return {
isDeleteTimelineModalOpen,
onCloseDeleteTimelineModal,
onOpenDeleteTimelineModal,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ export const OpenTimeline = React.memo<OpenTimelineProps>(
isDeleteTimelineModalOpen={isDeleteTimelineModalOpen}
isEnableDownloader={isEnableDownloader}
onComplete={onCompleteEditTimelineAction}
title={
actionItem != null && actionItem.title ? actionItem.title : i18n.SELECTED_TIMELINES(1)
}
title={actionItem?.title ?? i18n.SELECTED_TIMELINES(1)}
/>

<EuiPanel className={OPEN_TIMELINE_CLASS_NAME}>
Expand Down

0 comments on commit b1465a8

Please sign in to comment.