diff options
Diffstat (limited to 'packages/frontend/src/widgets/WidgetJobQueue.vue')
| -rw-r--r-- | packages/frontend/src/widgets/WidgetJobQueue.vue | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/packages/frontend/src/widgets/WidgetJobQueue.vue b/packages/frontend/src/widgets/WidgetJobQueue.vue index 877baaea02..1727ea9b74 100644 --- a/packages/frontend/src/widgets/WidgetJobQueue.vue +++ b/packages/frontend/src/widgets/WidgetJobQueue.vue @@ -52,6 +52,7 @@ SPDX-License-Identifier: AGPL-3.0-only <script lang="ts" setup> import { onUnmounted, reactive, ref } from 'vue'; +import * as Misskey from 'misskey-js'; import { useWidgetPropsManager } from './widget.js'; import type { WidgetComponentEmits, WidgetComponentExpose, WidgetComponentProps } from './widget.js'; import type { FormWithDefault, GetFormResultType } from '@/utility/form.js'; @@ -116,20 +117,22 @@ if (prefer.s['sound.masterVolume']) { } for (const domain of ['inbox', 'deliver']) { - prev[domain] = deepClone(current[domain]); + const d = domain as 'inbox' | 'deliver'; + prev[d] = deepClone(current[d]); } -const onStats = (stats) => { +const onStats = (stats: Misskey.entities.QueueStats) => { for (const domain of ['inbox', 'deliver']) { - prev[domain] = deepClone(current[domain]); - current[domain].activeSincePrevTick = stats[domain].activeSincePrevTick; - current[domain].active = stats[domain].active; - current[domain].waiting = stats[domain].waiting; - current[domain].delayed = stats[domain].delayed; + const d = domain as 'inbox' | 'deliver'; + prev[d] = deepClone(current[d]); + current[d].activeSincePrevTick = stats[d].activeSincePrevTick; + current[d].active = stats[d].active; + current[d].waiting = stats[d].waiting; + current[d].delayed = stats[d].delayed; - if (current[domain].waiting > 0 && widgetProps.sound && jammedAudioBuffer.value && !jammedSoundNodePlaying.value) { + if (current[d].waiting > 0 && widgetProps.sound && jammedAudioBuffer.value && !jammedSoundNodePlaying.value) { const soundNode = sound.createSourceNode(jammedAudioBuffer.value, {}).soundSource; - if (soundNode) { + if (soundNode != null) { jammedSoundNodePlaying.value = true; soundNode.onended = () => jammedSoundNodePlaying.value = false; soundNode.start(); @@ -138,7 +141,7 @@ const onStats = (stats) => { } }; -const onStatsLog = (statsLog) => { +const onStatsLog = (statsLog: Misskey.entities.QueueStatsLog) => { for (const stats of [...statsLog].reverse()) { onStats(stats); } |