diff --git a/packages/frontend/src/scripts/use-interval.ts b/packages/frontend/src/scripts/use-interval.ts index 201ba417ef..601dea6724 100644 --- a/packages/frontend/src/scripts/use-interval.ts +++ b/packages/frontend/src/scripts/use-interval.ts @@ -3,7 +3,7 @@ import { onMounted, onUnmounted } from 'vue'; export function useInterval(fn: () => void, interval: number, options: { immediate: boolean; afterMounted: boolean; -}): void { +}): (() => void) | undefined { if (Number.isNaN(interval)) return; let intervalId: number | null = null; @@ -18,7 +18,14 @@ export function useInterval(fn: () => void, interval: number, options: { intervalId = window.setInterval(fn, interval); } - onUnmounted(() => { + const clear = () => { if (intervalId) window.clearInterval(intervalId); + intervalId = null; + }; + + onUnmounted(() => { + clear(); }); + + return clear; } diff --git a/packages/frontend/src/widgets/rss-ticker.vue b/packages/frontend/src/widgets/rss-ticker.vue index c2d6dd2873..37672e13cf 100644 --- a/packages/frontend/src/widgets/rss-ticker.vue +++ b/packages/frontend/src/widgets/rss-ticker.vue @@ -3,13 +3,15 @@ -
- -
- +
+
+ +
+
+ - - {{ item.title }} + + {{ item.title }} @@ -19,14 +21,14 @@ - diff --git a/packages/frontend/src/widgets/rss.vue b/packages/frontend/src/widgets/rss.vue index c0338c8e47..554413cd1e 100644 --- a/packages/frontend/src/widgets/rss.vue +++ b/packages/frontend/src/widgets/rss.vue @@ -5,19 +5,24 @@
-
- {{ item.title }} +
+ +
{{ i18n.ts.nothing }}
+
+
-