소스 검색

app opens in edit mode if there is only one revision

Skylsmoi 5 년 전
부모
커밋
e53cdfff27
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/container/HtmlDocument.jsx

+ 4 - 1
src/container/HtmlDocument.jsx 파일 보기

@@ -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)