@@ -125,8 +125,6 @@ export const onMentionSearch = name => {
125125
126126export const onMention = user => store . addReferUser ( user )
127127
128- // const loadPost = id => sr71$.query(S.post, { id })
129-
130128const openAttachment = att => {
131129 if ( store . activeThread === THREAD . RADAR ) {
132130 store . updateEditing ( { copyRight : 'reprint' } )
@@ -136,8 +134,6 @@ const openAttachment = att => {
136134 // const { type } = att
137135 // if (type === TYPE.PREVIEW_POST_EDIT) loadPost(att.id)
138136
139- // const { id, title, body, digest } = att
140-
141137 store . updateEditing ( att )
142138 store . markState ( { isEdit : true } )
143139}
@@ -152,7 +148,10 @@ export const inputOnChange = (part, e) => updateEditing(store, part, e)
152148export const bodyInputOnChange = content => {
153149 store . markState ( { extractMentions : extractMentions ( content ) } )
154150
155- // extractMentions: extractMentions(content)
151+ // draft.js will mis trigger onChange event with empty string.
152+ // currently this is a bug: in edit can't update to empty.
153+ if ( store . isEdit && content === '' ) return false
154+
156155 updateEditing ( store , 'body' , content )
157156}
158157
@@ -190,13 +189,6 @@ const DataSolver = [
190189 dispatchEvent ( EVENT . REFRESH_POSTS )
191190 } ,
192191 } ,
193- {
194- match : asyncRes ( 'post' ) ,
195- action : ( { post } ) => {
196- debug ( 'before updateEditing: ' , post )
197- store . updateEditing ( post )
198- } ,
199- } ,
200192 {
201193 match : asyncRes ( 'searchUsers' ) ,
202194 action : ( { searchUsers : { entries } } ) => store . updateMentionList ( entries ) ,
0 commit comments