This commit is contained in:
parent
4e29da828f
commit
7e7aece2f5
|
@ -238,7 +238,16 @@ const translation = ref<any>(null);
|
||||||
const translating = ref(false);
|
const translating = ref(false);
|
||||||
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && !!appearNote?.user.instance);
|
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));
|
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 = {
|
const keymap = {
|
||||||
'r': () => reply(true),
|
'r': () => reply(true),
|
||||||
|
@ -518,12 +527,14 @@ onActivated(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
onDeactivated(() => {
|
onDeactivated(() => {
|
||||||
if (unuse.value) {
|
// 不要なキャッシュ消去や通信を防止するため遅延させる
|
||||||
unuse.value();
|
setTimeout(() => {
|
||||||
unuse.value = undefined;
|
if (unuse.value) {
|
||||||
}
|
unuse.value();
|
||||||
|
unuse.value = undefined;
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
|
@ -131,7 +131,8 @@ export class NoteManager {
|
||||||
public async fetch(id: string, force = false): Promise<CachedNote> {
|
public async fetch(id: string, force = false): Promise<CachedNote> {
|
||||||
if (!force) {
|
if (!force) {
|
||||||
const updatedAt = this.updatedAt.get(id);
|
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);
|
const cachedNote = this.get(id);
|
||||||
if (cachedNote) {
|
if (cachedNote) {
|
||||||
return cachedNote;
|
return cachedNote;
|
||||||
|
|
Loading…
Reference in New Issue