Compare commits

...

4 Commits

Author SHA1 Message Date
tamaina b73f88fe54 ✌️ 2023-08-04 11:01:43 +00:00
tamaina fc0d9366d8 削除時の挙動をちゃんとする 2023-08-04 10:53:26 +00:00
tamaina 150b4d7715
Merge branch 'develop' into noman 2023-08-04 19:43:37 +09:00
tamaina b465bcd601 chore(frontend): video sourceからtypeを削除
Resolve #7894
2023-08-02 08:14:17 +00:00
2 changed files with 21 additions and 7 deletions

View File

@ -24,7 +24,6 @@ SPDX-License-Identifier: AGPL-3.0-only
>
<source
:src="video.url"
:type="video.type"
>
</video>
<i class="ti ti-eye-off" :class="$style.hide" @click="hide = true"></i>

View File

@ -224,6 +224,10 @@ export class NoteManager {
public async fetch(id: string, force = false): Promise<CachedNote> {
if (!force) {
const cachedNote = this.get(id);
if (cachedNote.value === null) {
// 削除されている場合はnullを返す
return cachedNote;
}
// Renoteの場合はRenote元の更新日時も考慮する
const updatedAt = isRenote(cachedNote.value) ?
this.updatedAt.get(id) :
@ -264,13 +268,20 @@ export class NoteManager {
const reaction = body.reaction;
if (body.emoji && !(body.emoji.name in note.value.reactionEmojis)) {
note.value.reactionEmojis[body.emoji.name] = body.emoji.url;
}
note.value.reactionEmojis = {
...note.value.reactionEmojis,
[body.emoji.name]: body.emoji.url,
};
}
// TODO: reactionsプロパティがない場合ってあったっけ なければ || {} は消せる
const currentCount = (note.value.reactions || {})[reaction] || 0;
note.value.reactions[reaction] = currentCount + 1;
if (reaction in note.value.reactions) {
note.value.reactions[reaction]++;
} else {
note.value.reactions = {
...note.value.reactions,
[reaction]: 1,
};
}
if ($i && (body.userId === $i.id)) {
note.value.myReaction = reaction;
@ -311,6 +322,10 @@ export class NoteManager {
case 'deleted': {
note.value = null;
this.connection?.send('un', { id });
this.captureing.delete(id);
this.notesComputed.delete(id);
this.updatedAt.delete(id);
break;
}
}