From c06aaef8f9a82b75fd40d3664a7b37eb9eb4e0c8 Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Tue, 10 Nov 2026 12:07:41 +0100 Subject: [PATCH] tauri-events, tauri-api, tauri-utils: mark fire-and-forget promises with void Resolves SonarCloud typescript:S9383 in the Tauri frontend libraries. --- .../libs/tauri-api/src/lib/events/CanvasBgRemovedEvent.ts | 6 +++--- .../libs/tauri-api/src/lib/sora/useSoraLoginListener.ts | 2 +- .../src/lib/events/functional/CreditsBalanceChangedEvent.ts | 6 +++--- .../src/lib/events/functional/ImageEditCompleteEvent.ts | 6 +++--- .../src/lib/events/functional/MediaFileDeletedEvent.ts | 6 +++--- .../lib/events/functional/ObjectGenerationCompleteEvent.ts | 6 +++--- .../src/lib/events/functional/RefreshAccountStateEvent.ts | 6 +++--- .../lib/events/functional/ShowProviderBillingModalEvent.ts | 6 +++--- .../lib/events/functional/ShowProviderLoginModalEvent.ts | 6 +++--- .../lib/events/functional/SubscriptionPlanChangedEvent.ts | 6 +++--- .../events/functional/TextToImageGenerationCompleteEvent.ts | 6 +++--- .../lib/events/functional/VideoGenerationCompleteEvent.ts | 6 +++--- .../src/lib/events/generation/useGenerationCompleteEvent.ts | 6 +++--- .../events/generation/useGenerationEnqueueFailureEvent.ts | 6 +++--- .../events/generation/useGenerationEnqueueSuccessEvent.ts | 6 +++--- .../src/lib/events/generation/useGenerationFailedEvent.ts | 6 +++--- .../src/lib/events/warning/FlashFileDownloadErrorEvent.ts | 6 +++--- .../src/lib/events/warning/FlashUserInputErrorEvent.ts | 6 +++--- frontend/libs/tauri-utils/src/lib/useWindowControls.ts | 2 +- 19 files changed, 53 insertions(+), 53 deletions(-) diff --git a/frontend/libs/tauri-api/src/lib/events/CanvasBgRemovedEvent.ts b/frontend/libs/tauri-api/src/lib/events/CanvasBgRemovedEvent.ts index bfe766db2d..29c915508a 100644 --- a/frontend/libs/tauri-api/src/lib/events/CanvasBgRemovedEvent.ts +++ b/frontend/libs/tauri-api/src/lib/events/CanvasBgRemovedEvent.ts @@ -22,15 +22,15 @@ export const useCanvasBgRemovedEvent = (asyncCallback: (event: CanvasBgRemovedEv }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-api/src/lib/sora/useSoraLoginListener.ts b/frontend/libs/tauri-api/src/lib/sora/useSoraLoginListener.ts index 40cb23a8d0..563daabc2b 100644 --- a/frontend/libs/tauri-api/src/lib/sora/useSoraLoginListener.ts +++ b/frontend/libs/tauri-api/src/lib/sora/useSoraLoginListener.ts @@ -21,7 +21,7 @@ export function useSoraLoginListener( unlisten = stop; }; - setupListener(); + void setupListener(); return () => { if (unlisten) unlisten(); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/CreditsBalanceChangedEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/CreditsBalanceChangedEvent.ts index 1a1e8731d6..d214b37697 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/CreditsBalanceChangedEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/CreditsBalanceChangedEvent.ts @@ -23,15 +23,15 @@ export const useCreditsBalanceChangedEvent = ( ); if (isUnmounted) { - unlisten.then((f) => f()); // Unsubscribe if unmounted early. + void unlisten.then((f) => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then((f) => f()); + void unlisten.then((f) => f()); }; }, []); }; diff --git a/frontend/libs/tauri-events/src/lib/events/functional/ImageEditCompleteEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/ImageEditCompleteEvent.ts index 0d5f38207f..c252a46fd5 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/ImageEditCompleteEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/ImageEditCompleteEvent.ts @@ -27,15 +27,15 @@ export const useImageEditCompleteEvent = (asyncCallback: (event: ImageEditComple }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/MediaFileDeletedEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/MediaFileDeletedEvent.ts index d5a1a864ae..9854100fd7 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/MediaFileDeletedEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/MediaFileDeletedEvent.ts @@ -24,15 +24,15 @@ export const useMediaFileDeletedEvent = ( ); if (isUnmounted) { - unlisten.then((f) => f()); // Unsubscribe if unmounted early. + void unlisten.then((f) => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then((f) => f()); + void unlisten.then((f) => f()); }; }, []); }; diff --git a/frontend/libs/tauri-events/src/lib/events/functional/ObjectGenerationCompleteEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/ObjectGenerationCompleteEvent.ts index aac39c01a5..1483bbed6d 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/ObjectGenerationCompleteEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/ObjectGenerationCompleteEvent.ts @@ -32,15 +32,15 @@ export const useObjectGenerationCompleteEvent = ( ); if (isUnmounted) { - unlisten.then((f) => f()); // Unsubscribe if unmounted early. + void unlisten.then((f) => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then((f) => f()); + void unlisten.then((f) => f()); }; }, []); }; diff --git a/frontend/libs/tauri-events/src/lib/events/functional/RefreshAccountStateEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/RefreshAccountStateEvent.ts index 7d4bdf7094..4b6b6ddd2d 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/RefreshAccountStateEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/RefreshAccountStateEvent.ts @@ -19,15 +19,15 @@ export const useRefreshAccountStateEvent = (asyncCallback: (event: RefreshAccoun }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderBillingModalEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderBillingModalEvent.ts index 6a58779ccc..3dd9a89bd0 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderBillingModalEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderBillingModalEvent.ts @@ -20,15 +20,15 @@ export const useShowProviderBillingModalEvent = (asyncCallback: (event: ShowProv }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderLoginModalEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderLoginModalEvent.ts index d971ba27de..3a62e7825e 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderLoginModalEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/ShowProviderLoginModalEvent.ts @@ -20,15 +20,15 @@ export const useShowProviderLoginModalEvent = (asyncCallback: (event: ShowProvid }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/SubscriptionPlanChangedEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/SubscriptionPlanChangedEvent.ts index e55f9bd9e7..f141ea9f3b 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/SubscriptionPlanChangedEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/SubscriptionPlanChangedEvent.ts @@ -23,15 +23,15 @@ export const useSubscriptionPlanChangedEvent = ( ); if (isUnmounted) { - unlisten.then((f) => f()); // Unsubscribe if unmounted early. + void unlisten.then((f) => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then((f) => f()); + void unlisten.then((f) => f()); }; }, []); }; diff --git a/frontend/libs/tauri-events/src/lib/events/functional/TextToImageGenerationCompleteEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/TextToImageGenerationCompleteEvent.ts index 77175c3c7b..1add5010d5 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/TextToImageGenerationCompleteEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/TextToImageGenerationCompleteEvent.ts @@ -27,15 +27,15 @@ export const useTextToImageGenerationCompleteEvent = (asyncCallback: (event: Tex }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/functional/VideoGenerationCompleteEvent.ts b/frontend/libs/tauri-events/src/lib/events/functional/VideoGenerationCompleteEvent.ts index 68aca6f3c7..bec828c3a9 100644 --- a/frontend/libs/tauri-events/src/lib/events/functional/VideoGenerationCompleteEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/functional/VideoGenerationCompleteEvent.ts @@ -27,15 +27,15 @@ export const useVideoGenerationCompleteEvent = (asyncCallback: (event: VideoGene }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationCompleteEvent.ts b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationCompleteEvent.ts index d38c5173fd..a8df20e414 100644 --- a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationCompleteEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationCompleteEvent.ts @@ -25,15 +25,15 @@ export const useGenerationCompleteEvent = () => { }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueFailureEvent.ts b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueFailureEvent.ts index 6d5ed2ce78..4a7d8813fc 100644 --- a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueFailureEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueFailureEvent.ts @@ -26,15 +26,15 @@ export const useGenerationEnqueueFailureEvent = () => { }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueSuccessEvent.ts b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueSuccessEvent.ts index fd75a0cb1e..36f788c508 100644 --- a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueSuccessEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationEnqueueSuccessEvent.ts @@ -25,15 +25,15 @@ export const useGenerationEnqueueSuccessEvent = () => { }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationFailedEvent.ts b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationFailedEvent.ts index c69242f180..8c59076e70 100644 --- a/frontend/libs/tauri-events/src/lib/events/generation/useGenerationFailedEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/generation/useGenerationFailedEvent.ts @@ -26,15 +26,15 @@ export const useGenerationFailedEvent = () => { }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/warning/FlashFileDownloadErrorEvent.ts b/frontend/libs/tauri-events/src/lib/events/warning/FlashFileDownloadErrorEvent.ts index c944f32139..c3927344a1 100644 --- a/frontend/libs/tauri-events/src/lib/events/warning/FlashFileDownloadErrorEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/warning/FlashFileDownloadErrorEvent.ts @@ -28,15 +28,15 @@ export const useFlashFileDownloadErrorEvent = (asyncCallback: (event: FlashFileD }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-events/src/lib/events/warning/FlashUserInputErrorEvent.ts b/frontend/libs/tauri-events/src/lib/events/warning/FlashUserInputErrorEvent.ts index ac083bb2c8..12dd2f7c63 100644 --- a/frontend/libs/tauri-events/src/lib/events/warning/FlashUserInputErrorEvent.ts +++ b/frontend/libs/tauri-events/src/lib/events/warning/FlashUserInputErrorEvent.ts @@ -19,15 +19,15 @@ export const useFlashUserInputErrorEvent = (asyncCallback: (event: FlashUserInpu }); if (isUnmounted) { - unlisten.then(f => f()); // Unsubscribe if unmounted early. + void unlisten.then(f => f()); // Unsubscribe if unmounted early. } }; - setup(); + void setup(); return () => { isUnmounted = true; - unlisten.then(f => f()); + void unlisten.then(f => f()); }; }, []); diff --git a/frontend/libs/tauri-utils/src/lib/useWindowControls.ts b/frontend/libs/tauri-utils/src/lib/useWindowControls.ts index 8c2da336d9..05e8995f50 100644 --- a/frontend/libs/tauri-utils/src/lib/useWindowControls.ts +++ b/frontend/libs/tauri-utils/src/lib/useWindowControls.ts @@ -16,7 +16,7 @@ export function useTauriWindowControls() { let unlistenUnmax: (() => void) | undefined; let unlistenResize: (() => void) | undefined; - (async () => { + void (async () => { try { const win = await getCurrentWindowSafe(); setIsMaximized(await win.isMaximized());