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

Star a note

This commit is contained in:
Dick Choi
2016-05-29 13:08:02 +09:00
parent eb210e9072
commit 5a26fc812d
7 changed files with 205 additions and 4 deletions

View File

@@ -136,6 +136,21 @@ class NoteList extends React.Component {
}, [])
}
if (location.pathname.match(/\/starred/)) {
return repositories
.reduce((sum, repository) => {
return sum.concat(repository.starred
.map((starredKey) => {
return _.find(repository.notes, {key: starredKey})
})
.filter((note) => _.isObject(note))
.map((note) => {
note._repository = repository
return note
}))
}, [])
}
let repository = _.find(repositories, {key: repositoryKey})
if (repository == null) return []