Browse Source

add onCreate

visuddhinanda 2 years ago
parent
commit
1c0f33532b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      dashboard/src/components/template/SentEdit/SentCanRead.tsx

+ 5 - 0
dashboard/src/components/template/SentEdit/SentCanRead.tsx

@@ -22,6 +22,7 @@ interface IWidget {
   channelsId?: string[];
   channelsId?: string[];
   reload?: boolean;
   reload?: boolean;
   onReload?: Function;
   onReload?: Function;
+  onCreate?: Function;
 }
 }
 const SentCanReadWidget = ({
 const SentCanReadWidget = ({
   book,
   book,
@@ -32,6 +33,7 @@ const SentCanReadWidget = ({
   channelsId,
   channelsId,
   reload = false,
   reload = false,
   onReload,
   onReload,
+  onCreate,
 }: IWidget) => {
 }: IWidget) => {
   const [sentData, setSentData] = useState<ISentence[]>([]);
   const [sentData, setSentData] = useState<ISentence[]>([]);
   const [channels, setChannels] = useState<string[]>();
   const [channels, setChannels] = useState<string[]>();
@@ -140,6 +142,9 @@ const SentCanReadWidget = ({
               return [newSent.channel.id];
               return [newSent.channel.id];
             }
             }
           });
           });
+          if (typeof onCreate !== "undefined") {
+            onCreate();
+          }
         }}
         }}
       />
       />