1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

debug - 新規投稿が不可能

This commit is contained in:
Rokt33r
2015-12-13 19:10:05 +09:00
parent 57912b5a5a
commit 3bd5d6b9f6
2 changed files with 3 additions and 5 deletions

View File

@@ -298,7 +298,7 @@ export default class ArticleDetail extends React.Component {
dispatch(unlockStatus()) dispatch(unlockStatus())
delete newArticle.status newArticle.status = null
newArticle.updatedAt = new Date() newArticle.updatedAt = new Date()
newArticle.title = newArticle.title.trim() newArticle.title = newArticle.title.trim()
if (newArticle.createdAt == null) { if (newArticle.createdAt == null) {

View File

@@ -181,12 +181,10 @@ function articles (state = initialArticles, action) {
let targetIndex = _.findIndex(state, _article => article.key === _article.key) let targetIndex = _.findIndex(state, _article => article.key === _article.key)
if (targetIndex < 0) state.unshift(article) if (targetIndex < 0) state.unshift(article)
else { else Object.assign(state[targetIndex], article)
Object.assign(state[targetIndex], article)
}
if (article.status !== 'NEW') dataStore.setArticles(state) if (article.status !== 'NEW') dataStore.setArticles(state)
else isCreatingNew = true else isCreatingNew = true
return state return state
} }
case ARTICLE_DESTROY: case ARTICLE_DESTROY: