Просмотр исходного кода

app opens in edit mode if there is only one revision

Skylsmoi 7 лет назад
Родитель
Сommit
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)