|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
|
|
-import React, { useEffect } from 'react';
|
|
|
|
|
|
|
+import React, { useEffect, useCallback } from 'react';
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
@@ -26,20 +26,20 @@ const logger = loggerFactory('growi:services:AdminCustomizePage');
|
|
|
function Customize(props) {
|
|
function Customize(props) {
|
|
|
const { adminCustomizeContainer } = props;
|
|
const { adminCustomizeContainer } = props;
|
|
|
|
|
|
|
|
- useEffect(() => {
|
|
|
|
|
- async function fetchCustomizeSettingsData() {
|
|
|
|
|
- await adminCustomizeContainer.retrieveCustomizeData();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ const fetchCustomizeSettingsData = useCallback(async() => {
|
|
|
try {
|
|
try {
|
|
|
- fetchCustomizeSettingsData();
|
|
|
|
|
|
|
+ await adminCustomizeContainer.retrieveCustomizeData()
|
|
|
}
|
|
}
|
|
|
catch (err) {
|
|
catch (err) {
|
|
|
const errs = toArrayIfNot(err);
|
|
const errs = toArrayIfNot(err);
|
|
|
toastError(errs);
|
|
toastError(errs);
|
|
|
logger.error(errs);
|
|
logger.error(errs);
|
|
|
}
|
|
}
|
|
|
- }, [adminCustomizeContainer]);
|
|
|
|
|
|
|
+ }, []);
|
|
|
|
|
+
|
|
|
|
|
+ useEffect(() => {
|
|
|
|
|
+ fetchCustomizeSettingsData();
|
|
|
|
|
+ }, [fetchCustomizeSettingsData]);
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
return (
|