|
@@ -6,7 +6,7 @@ import { Modal, ModalHeader, ModalBody } from 'reactstrap';
|
|
|
|
|
|
|
|
import { useOnTemplateButtonClicked } from '~/client/services/use-on-template-button-clicked';
|
|
import { useOnTemplateButtonClicked } from '~/client/services/use-on-template-button-clicked';
|
|
|
import { toastError } from '~/client/util/toastr';
|
|
import { toastError } from '~/client/util/toastr';
|
|
|
-import { TargetType, LabelType } from '~/interfaces/template';
|
|
|
|
|
|
|
+import type { TargetType, LabelType } from '~/interfaces/template';
|
|
|
|
|
|
|
|
|
|
|
|
|
type TemplateCardProps = {
|
|
type TemplateCardProps = {
|
|
@@ -60,11 +60,12 @@ export const CreateTemplateModal: React.FC<CreateTemplateModalProps> = ({
|
|
|
const onClickTemplateButtonHandler = useCallback(async(label: LabelType) => {
|
|
const onClickTemplateButtonHandler = useCallback(async(label: LabelType) => {
|
|
|
try {
|
|
try {
|
|
|
await onClickTemplateButton(label);
|
|
await onClickTemplateButton(label);
|
|
|
|
|
+ onClose();
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
}
|
|
}
|
|
|
- }, [onClickTemplateButton]);
|
|
|
|
|
|
|
+ }, [onClickTemplateButton, onClose]);
|
|
|
|
|
|
|
|
const parentPath = pathUtils.addTrailingSlash(path);
|
|
const parentPath = pathUtils.addTrailingSlash(path);
|
|
|
|
|
|