Browse Source

app opens in edit mode if there is only one revision

Skylsmoi 5 years ago
parent
commit
e53cdfff27
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/container/HtmlDocument.jsx

+ 4 - 1
src/container/HtmlDocument.jsx View File

@@ -121,7 +121,10 @@ class HtmlDocument extends React.Component {
121 121
             }))
122 122
           ], [])
123 123
 
124
-        this.setState({timeline: revisionWithComment})
124
+        this.setState({
125
+          timeline: revisionWithComment,
126
+          mode: resRevision.body.length === 1 ? MODE.EDIT : MODE.VIEW // first time editing the doc, open in edit mode
127
+        })
125 128
       })
126 129
       .catch(e => {
127 130
         console.log('Error loading Timeline.', e)