kaori 3 лет назад
Родитель
Сommit
77b2bf7747

+ 4 - 1
packages/app/src/components/Admin/Notification/ManageGlobalNotification.jsx

@@ -45,12 +45,14 @@ const ManageGlobalNotification = (props) => {
     }
   }, [globalNotificationId]);
 
+
   useEffect(() => {
     if (props.globalNotificationId != null) {
       retrieveGlobalNotificationData();
     }
   }, [props.globalNotificationId, retrieveGlobalNotificationData]);
 
+
   const onChangeTriggerEvents = useCallback((triggerEvent) => {
     let newTriggerEvents;
 
@@ -64,8 +66,8 @@ const ManageGlobalNotification = (props) => {
     }
   }, [triggerEvents]);
 
-  const updateButtonClickedHandler = useCallback(async() => {
 
+  const updateButtonClickedHandler = useCallback(async() => {
     const requestParams = {
       triggerPath,
       notifyType,
@@ -88,6 +90,7 @@ const ManageGlobalNotification = (props) => {
     }
   }, [emailToSend, globalNotificationId, notifyType, slackChannelToSend, triggerEvents, triggerPath]);
 
+
   const { data: isMailerSetup } = useIsMailerSetup();
   const { adminNotificationContainer } = props;
   const { t } = useTranslation('admin');

+ 5 - 2
packages/app/src/pages/admin/global-notification/[globalNotificationId].page.tsx

@@ -22,10 +22,13 @@ const AdminGlobalNotificationNewPage: NextPage<CommonProps> = (props) => {
   const { globalNotificationId } = router.query;
 
   const title = t('external_notification.external_notification');
-  const injectableContainers: Container<any>[] = [];
+  const customTitle = useCustomTitle(props, title);
+
 
   const currentGlobalNotificationId = Array.isArray(globalNotificationId) ? globalNotificationId[0] : globalNotificationId;
 
+  const injectableContainers: Container<any>[] = [];
+
   if (isClient()) {
     const adminNotificationContainer = new AdminNotificationContainer();
     injectableContainers.push(adminNotificationContainer);
@@ -34,7 +37,7 @@ const AdminGlobalNotificationNewPage: NextPage<CommonProps> = (props) => {
 
   return (
     <Provider inject={[...injectableContainers]}>
-      <AdminLayout title={useCustomTitle(props, title)} componentTitle={title} >
+      <AdminLayout title={customTitle} componentTitle={title} >
         {
           currentGlobalNotificationId != null && router.isReady
       && <ManageGlobalNotification globalNotificationId={currentGlobalNotificationId} />