diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-20 19:00:09 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-03-20 19:00:09 +0900 |
| commit | 6015254e59ba0526efbfa139c89546458663ccbd (patch) | |
| tree | 97adc609448eb3ce96730051193042c9eec470db /packages/frontend/src/stream.ts | |
| parent | Update eslint.config.js (diff) | |
| download | misskey-6015254e59ba0526efbfa139c89546458663ccbd.tar.gz misskey-6015254e59ba0526efbfa139c89546458663ccbd.tar.bz2 misskey-6015254e59ba0526efbfa139c89546458663ccbd.zip | |
lint fixes
Diffstat (limited to 'packages/frontend/src/stream.ts')
| -rw-r--r-- | packages/frontend/src/stream.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/frontend/src/stream.ts b/packages/frontend/src/stream.ts index c97d7d4071..25544d9d88 100644 --- a/packages/frontend/src/stream.ts +++ b/packages/frontend/src/stream.ts @@ -29,10 +29,10 @@ export function useStream(): Misskey.IStream { timeoutHeartBeat = window.setTimeout(heartbeat, HEART_BEAT_INTERVAL); // send heartbeat right now when last send time is over HEART_BEAT_INTERVAL - document.addEventListener('visibilitychange', () => { + window.document.addEventListener('visibilitychange', () => { if ( !stream - || document.visibilityState !== 'visible' + || window.document.visibilityState !== 'visible' || Date.now() - lastHeartbeatCall < HEART_BEAT_INTERVAL ) return; heartbeat(); @@ -42,7 +42,7 @@ export function useStream(): Misskey.IStream { } function heartbeat(): void { - if (stream != null && document.visibilityState === 'visible') { + if (stream != null && window.document.visibilityState === 'visible') { stream.heartbeat(); } lastHeartbeatCall = Date.now(); |