summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-01-04 08:54:54 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-01-04 08:54:54 +0900
commit697836c17cc41ee8dff7d4daca51a89d9b0bd319 (patch)
tree1dc3f3caea2722e79dd1597f5b61838dca8d3876 /packages
parent:art: (diff)
downloadmisskey-697836c17cc41ee8dff7d4daca51a89d9b0bd319.tar.gz
misskey-697836c17cc41ee8dff7d4daca51a89d9b0bd319.tar.bz2
misskey-697836c17cc41ee8dff7d4daca51a89d9b0bd319.zip
perf(client): improve MkTime performance
Diffstat (limited to 'packages')
-rw-r--r--packages/frontend/src/components/global/MkTime.vue5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/frontend/src/components/global/MkTime.vue b/packages/frontend/src/components/global/MkTime.vue
index 0bbb0f5399..704e6d0de0 100644
--- a/packages/frontend/src/components/global/MkTime.vue
+++ b/packages/frontend/src/components/global/MkTime.vue
@@ -37,12 +37,13 @@ const relative = $computed(() => {
});
function tick() {
- // TODO: パフォーマンス向上のため、このコンポーネントが画面内に表示されている場合のみ更新する
now = new Date();
+ const ago = (now.getTime() - _time.getTime()) / 1000/*ms*/;
+ const next = ago < 60 ? 10000 : ago < 3600 ? 60000 : 180000;
tickId = window.setTimeout(() => {
window.requestAnimationFrame(tick);
- }, 10000);
+ }, next);
}
let tickId: number;