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

Add trash can

This commit is contained in:
asmsuechan
2017-07-12 15:34:40 +09:00
parent ec560ceab1
commit 2650cc2f1c
11 changed files with 294 additions and 141 deletions

View File

@@ -257,6 +257,11 @@ class NoteList extends React.Component {
return searchFromNotes(this.props.data, searchInputText)
}
if (location.pathname.match(/\/trashed/)) {
return data.trashedSet.toJS()
.map((uniqueKey) => data.noteMap.get(uniqueKey))
}
let storageKey = params.storageKey
let folderKey = params.folderKey
let storage = data.storageMap.get(storageKey)
@@ -411,6 +416,10 @@ class NoteList extends React.Component {
: sortByUpdatedAt
this.notes = notes = this.getNotes()
.sort(sortFunc)
.filter((note) => {
// this is for the trash box
if (note.isTrashed !== true || location.pathname === '/trashed') return true
})
let noteList = notes
.map(note => {