perf: Reduce database query
This commit is contained in:
parent
5e61c60f85
commit
87c8f9ff95
8 changed files with 114 additions and 123 deletions
|
@ -325,7 +325,15 @@ export default defineComponent({
|
|||
|
||||
capture(withHandler = false) {
|
||||
if (this.$i) {
|
||||
this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
|
||||
this.connection.send('sn', { id: this.appearNote.id });
|
||||
if (this.appearNote.userId !== this.$i.id) {
|
||||
if (this.appearNote.mentions && this.appearNote.mentions.includes(this.$i.id)) {
|
||||
this.connection.send('readMention', { id: this.appearNote.id });
|
||||
}
|
||||
if (this.appearNote.visibleUserIds && this.appearNote.visibleUserIds.includes(this.$i.id)) {
|
||||
this.connection.send('readSpecifiedNote', { id: this.appearNote.id });
|
||||
}
|
||||
}
|
||||
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue