soumaeda 2 лет назад
Родитель
Сommit
abaa475860
1 измененных файлов с 3 добавлено и 7 удалено
  1. 3 7
      packages/editor/src/stores/use-drawio.ts

+ 3 - 7
packages/editor/src/stores/use-drawio.ts

@@ -3,18 +3,14 @@ import { useCallback } from 'react';
 import { useSWRStatic } from '@growi/core/dist/swr';
 import type { SWRResponse } from 'swr';
 
-type DrawioModalSaveHandler = () => void;
-
 type DrawioModalStatus = {
   isOpened: boolean,
   editorKey: string | undefined,
-  onSave?: DrawioModalSaveHandler,
 }
 
 type DrawioModalStatusUtils = {
   open(
     editorKey: string,
-    onSave?: DrawioModalSaveHandler,
   ): void,
   close(): void,
 }
@@ -28,12 +24,12 @@ export const useDrawioModalForEditor = (status?: DrawioModalStatus): SWRResponse
 
   const { mutate } = swrResponse;
 
-  const open = useCallback((editorKey: string | undefined, onSave?: DrawioModalSaveHandler): void => {
-    mutate({ isOpened: true, editorKey, onSave });
+  const open = useCallback((editorKey: string | undefined): void => {
+    mutate({ isOpened: true, editorKey });
   }, [mutate]);
 
   const close = useCallback((): void => {
-    mutate({ isOpened: false, editorKey: undefined, onSave: undefined });
+    mutate({ isOpened: false, editorKey: undefined });
   }, [mutate]);
 
   return {