Sfoglia il codice sorgente

Fixed onSubmit to onClick

Taichi Masuyama 4 anni fa
parent
commit
a3612f630b
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      packages/app/src/components/PrivateLegacyPages.tsx

+ 3 - 1
packages/app/src/components/PrivateLegacyPages.tsx

@@ -148,7 +148,7 @@ const ConvertByPathModal = React.memo((props: ConvertByPathModalProps): JSX.Elem
         <input type="text" className="form-control" placeholder="/" value={currentInput} onChange={e => setInput(e.target.value)} />
       </ModalBody>
       <ModalFooter>
-        <button type="button" className="btn btn-primary" onSubmit={(e) => { e.preventDefault(); props.onSubmit?.(currentInput) }}>
+        <button type="button" className="btn btn-primary" onClick={() => props.onSubmit?.(currentInput)}>
           <i className="icon-fw icon-refresh" aria-hidden="true"></i>
           { t('private_legacy_pages.by_path_modal.button_label') }
         </button>
@@ -318,6 +318,7 @@ const PrivateLegacyPages = (props: Props): JSX.Element => {
         </div>
         <div className="d-flex pl-md-2">
           <button type="button" className="btn btn-light" onClick={() => setOpenConvertModal(true)}>
+            {/* TODO: i18n */}
             Input the path to convert
           </button>
         </div>
@@ -396,6 +397,7 @@ const PrivateLegacyPages = (props: Props): JSX.Element => {
               convertPath,
             });
             toastSuccess(t('private_legacy_pages.by_path_modal.success'));
+            setOpenConvertModal(false);
           }
           catch {
             toastError(t('private_legacy_pages.by_path_modal.error'));