Skip to content

Commit

Permalink
more strict regex pattern in pathname matching, fix #3183
Browse files Browse the repository at this point in the history
  • Loading branch information
hikerpig authored and Rokt33r committed Oct 10, 2019
1 parent 6b1c595 commit f181a7e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions browser/main/Detail/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ class Detail extends React.Component {
const searchStr = params.searchword
displayedNotes = searchStr === undefined || searchStr === '' ? allNotes
: searchFromNotes(allNotes, searchStr)
}

if (location.pathname.match(/\/tags/)) {
} else if (location.pathname.match(/^\/tags/)) {
const listOfTags = params.tagname.split(' ')
displayedNotes = data.noteMap.map(note => note).filter(note =>
listOfTags.every(tag => note.tags.includes(tag))
)
}

if (location.pathname.match(/\/trashed/)) {
if (location.pathname.match(/^\/trashed/)) {
displayedNotes = trashedNotes
} else {
displayedNotes = _.differenceWith(displayedNotes, trashedNotes, (note, trashed) => note.key === trashed.key)
Expand Down

0 comments on commit f181a7e

Please sign in to comment.