1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-20 13:11:44 +00:00

add DeleteArticleModal

This commit is contained in:
Rokt33r
2015-12-28 18:14:05 +09:00
parent a0a1c84db1
commit f3fbe38247
5 changed files with 82 additions and 5 deletions

View File

@@ -222,7 +222,9 @@ function articles (state = initialArticles, action) {
let articleKey = action.data.key
let targetIndex = _.findIndex(state.data, _article => articleKey === _article.key)
if (targetIndex >= 0) state.splice(targetIndex, 1)
if (targetIndex >= 0) state.data.splice(targetIndex, 1)
let modifiedIndex = _.findIndex(state.modified, _article => articleKey === _article.key)
if (modifiedIndex >= 0) state.modified.splice(modifiedIndex, 1)
dataStore.setArticles(state)
return state