浏览代码

app opens in edit mode if there is only one revision

Skylsmoi 7 年前
父节点
当前提交
e53cdfff27
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/container/HtmlDocument.jsx

+ 4 - 1
src/container/HtmlDocument.jsx 查看文件

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
       .catch(e => {
129
       .catch(e => {
127
         console.log('Error loading Timeline.', e)
130
         console.log('Error loading Timeline.', e)