fix notes filter in profile browsing.

This commit is contained in:
fiatjaf 2020-12-08 00:00:37 -03:00
parent f3872fb6f7
commit af56ddc7bd
3 changed files with 9 additions and 3 deletions

View File

@ -79,7 +79,7 @@
var rel = []
if (this.isFullPage) {
for (let k of this.$store.state.browsing.keys()) {
if (k.slice(0, 9) == 'rel:' + this.id.slice(0, 5)) {
if (k.slice(0, 10) == 'rel:' + this.id.slice(0, 5) + ':') {
rel.push(this.$store.state.browsing.get(k))
}
}

View File

@ -87,7 +87,10 @@
notes() {
var notes = []
for (let k of this.$store.state.browsing.keys()) {
if (k === 'from:' + this.$route.params.key) {
if (
k.slice(0, 11) ===
'from:' + this.$route.params.key.slice(0, 5) + ':'
) {
let note = this.$store.state.browsing.get(k)
notes.push(note)
}

View File

@ -88,7 +88,10 @@ export default {
receivedTextNote(state, {event: evt, context}) {
// all notes go to browsing
state.browsing.set(evt.id.slice(0, 5), evt)
state.browsing.set('from:' + evt.pubkey.slice(0, 5), evt)
state.browsing.set(
'from:' + evt.pubkey.slice(0, 5) + ':' + evt.id.slice(0, 5),
evt
)
if (evt.ref && evt.ref.length) {
state.browsing.set(
'rel:' + evt.ref.slice(0, 5) + ':' + evt.id.slice(0, 5),