|
@@ -1,5 +1,5 @@
|
|
|
/* eslint-disable react/no-danger */
|
|
/* eslint-disable react/no-danger */
|
|
|
-import React from 'react';
|
|
|
|
|
|
|
+import React, { useCallback } from 'react';
|
|
|
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
import {
|
|
import {
|
|
@@ -23,7 +23,7 @@ type Props = {
|
|
|
const IndentForm = (props: Props) => {
|
|
const IndentForm = (props: Props) => {
|
|
|
const { t } = useTranslation();
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
- const onClickSubmit = async(props) => {
|
|
|
|
|
|
|
+ const onClickSubmit = useCallback(async(props) => {
|
|
|
try {
|
|
try {
|
|
|
await props.adminMarkDownContainer.updateIndentSetting();
|
|
await props.adminMarkDownContainer.updateIndentSetting();
|
|
|
toastSuccess(t('toaster.update_successed', { target: t('admin:markdown_setting.indent_header') }));
|
|
toastSuccess(t('toaster.update_successed', { target: t('admin:markdown_setting.indent_header') }));
|
|
@@ -32,7 +32,7 @@ const IndentForm = (props: Props) => {
|
|
|
toastError(err);
|
|
toastError(err);
|
|
|
logger.error(err);
|
|
logger.error(err);
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }, [t]);
|
|
|
|
|
|
|
|
const renderIndentSizeOption = (props) => {
|
|
const renderIndentSizeOption = (props) => {
|
|
|
const { adminMarkDownContainer } = props;
|
|
const { adminMarkDownContainer } = props;
|