File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
apps/client/src/widgets/dialogs Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -31,21 +31,18 @@ export default function MarkdownImportDialog() {
3131 }
3232 } ) ;
3333
34- async function sendForm ( ) {
35- if ( textTypeWidget ) {
36- await convertMarkdownToHtml ( text , textTypeWidget ) ;
37- }
38-
39- setText ( "" ) ;
40- setShown ( false ) ;
41- }
42-
4334 return (
4435 < Modal
4536 className = "markdown-import-dialog" title = { t ( "markdown_import.dialog_title" ) } size = "lg"
46- footer = { < Button className = "markdown-import-button" text = { t ( "markdown_import.import_button" ) } onClick = { sendForm } keyboardShortcut = "Ctrl+Enter" /> }
37+ footer = { < Button className = "markdown-import-button" text = { t ( "markdown_import.import_button" ) } onClick = { ( ) => setShown ( false ) } keyboardShortcut = "Ctrl+Enter" /> }
4738 onShown = { ( ) => markdownImportTextArea . current ?. focus ( ) }
48- onHidden = { ( ) => setShown ( false ) }
39+ onHidden = { async ( ) => {
40+ if ( textTypeWidget ) {
41+ await convertMarkdownToHtml ( text , textTypeWidget ) ;
42+ }
43+ setShown ( false ) ;
44+ setText ( "" ) ;
45+ } }
4946 show = { shown }
5047 >
5148 < p > { t ( "markdown_import.modal_body_text" ) } </ p >
@@ -55,7 +52,7 @@ export default function MarkdownImportDialog() {
5552 onKeyDown = { ( e ) => {
5653 if ( e . key === "Enter" && e . ctrlKey ) {
5754 e . preventDefault ( ) ;
58- sendForm ( ) ;
55+ setShown ( false ) ;
5956 }
6057 } } > </ textarea >
6158 </ Modal >
You can’t perform that action at this time.
0 commit comments