This commit is contained in:
tamaina 2023-07-28 15:54:06 +00:00
parent 4e29da828f
commit 7e7aece2f5
2 changed files with 19 additions and 7 deletions

View File

@ -238,7 +238,16 @@ const translation = ref<any>(null);
const translating = ref(false);
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && !!appearNote?.user.instance);
const canRenote = computed(() => (!!appearNote && !!$i) && (['public', 'home'].includes(appearNote.visibility) || appearNote.userId === $i.id));
let renoteCollapsed = $ref(note && appearNote && defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null)));
let renoteCollapsed = $ref(
note &&
appearNote &&
defaultStore.state.collapseRenotes &&
isRenote.value &&
(
($i && ($i.id === note.userId || $i.id === appearNote.userId)) ||
(appearNote.myReaction != null)
)
);
const keymap = {
'r': () => reply(true),
@ -518,12 +527,14 @@ onActivated(() => {
});
onDeactivated(() => {
if (unuse.value) {
unuse.value();
unuse.value = undefined;
}
//
setTimeout(() => {
if (unuse.value) {
unuse.value();
unuse.value = undefined;
}
}, 1000);
});
</script>
<style lang="scss" module>

View File

@ -131,7 +131,8 @@ export class NoteManager {
public async fetch(id: string, force = false): Promise<CachedNote> {
if (!force) {
const updatedAt = this.updatedAt.get(id);
if (updatedAt && Date.now() - updatedAt < 1000 * 30) {
// 2分以上経過していない場合はキャッシュを返す
if (updatedAt && Date.now() - updatedAt < 1000 * 120) {
const cachedNote = this.get(id);
if (cachedNote) {
return cachedNote;