Przeglądaj źródła

use Object.assign

Yuken Tezuka 3 lat temu
rodzic
commit
f514b899ff
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      packages/app/src/stores/modal.tsx

+ 4 - 5
packages/app/src/stores/modal.tsx

@@ -571,13 +571,12 @@ export const useConflictDiffModal = (): SWRResponse<ConflictDiffModalStatus, Err
   const initialStatus: ConflictDiffModalStatus = { isOpened: false };
   const swrResponse = useStaticSWR<ConflictDiffModalStatus, Error>('conflictDiffModal', undefined, { fallbackData: initialStatus });
 
-  return {
-    ...swrResponse,
-    open() {
+  return Object.assign(swrResponse, {
+    open: () => {
       swrResponse.mutate({ isOpened: true });
     },
-    close() {
+    close: () => {
       swrResponse.mutate({ isOpened: false });
     },
-  };
+  });
 };