2
0
yusuketk 5 жил өмнө
parent
commit
8748999e34

+ 3 - 3
src/client/js/components/PageEditor/LinkEditModal.jsx

@@ -35,10 +35,10 @@ class LinkEditModal extends React.PureComponent {
       labelInputValue: '',
       linkerType: Linker.types.markdownLink,
       markdown: '',
+      previewError: '',
       permalink: '',
       linkText: '',
       isPreviewOpen: false,
-      previewError: '',
     };
 
     this.isApplyPukiwikiLikeLinkerPlugin = window.growiRenderer.preProcessors.some(process => process.constructor.name === 'PukiwikiLikeLinker');
@@ -150,8 +150,8 @@ class LinkEditModal extends React.PureComponent {
   async setMarkdown() {
     const path = this.state.linkInputValue;
     let markdown = '';
-    let permalink = '';
     let previewError = '';
+    let permalink = '';
 
     if (path.startsWith('/')) {
       const pathWithoutFragment = new URL(path, 'http://dummy').pathname;
@@ -171,7 +171,7 @@ class LinkEditModal extends React.PureComponent {
     else {
       previewError = `'${path}' is not a GROWI page.`;
     }
-    this.setState({ permalink, markdown, previewError });
+    this.setState({ markdown, previewError, permalink });
   }
 
   renderLinkPreview() {