kaori 3 лет назад
Родитель
Сommit
b70e4119a2
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      packages/app/src/stores/global-notification.ts

+ 2 - 4
packages/app/src/stores/global-notification.ts

@@ -1,5 +1,4 @@
 import { SWRResponseWithUtils, withUtils } from '@growi/core';
-import { SWRResponse } from 'swr';
 import useSWRImmutable from 'swr/immutable';
 
 
@@ -12,6 +11,7 @@ type Util = {
 };
 
 
+// TODO: typescriptize
 export const useSWRxGlobalNotification = (globalNotificationId: string): SWRResponseWithUtils<Util, any, Error> => {
   const swrResult = useSWRImmutable(
     globalNotificationId != null ? `/notification-setting/global-notification/${globalNotificationId}` : null,
@@ -24,14 +24,12 @@ export const useSWRxGlobalNotification = (globalNotificationId: string): SWRResp
 
 
   const update = async(updateData) => {
-    const { data, mutate } = swrResult;
+    const { data } = swrResult;
 
     if (data == null) {
       return;
     }
 
-    mutate({ ...data, ...updateData }, false);
-
     // invoke API
     await apiv3Put(`/notification-setting/global-notification/${globalNotificationId}`, updateData);
   };