1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

refactor: add new function and fix problems from feedbacks

This commit is contained in:
voidSatisfaction
2017-11-15 23:19:47 +09:00
parent 84f18ced47
commit a36e779980
2 changed files with 20 additions and 16 deletions

View File

@@ -144,8 +144,8 @@ class StorageItem extends React.Component {
dropNote (storage, folder, dispatch, location, noteData) {
noteData = noteData.filter((note) => folder.key !== note.folder)
const newNoteData = noteData.map((note) => Object.assign({}, note, {storage: storage, folder: folder.key}))
if (noteData.length === 0) return
const newNoteData = noteData.map((note) => Object.assign({}, note, {storage: storage, folder: folder.key}))
Promise.all(
newNoteData.map((note) => dataApi.createNote(storage.key, note))
@@ -167,7 +167,6 @@ class StorageItem extends React.Component {
)
})
.then((deletedNoteData) => {
console.log(deletedNoteData)
deletedNoteData.forEach((note) => {
dispatch({
type: 'DELETE_NOTE',