From 851e3b764074e8f22f191a990c4125e224836e01 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 9 Jun 2025 01:21:58 +0900 Subject: [PATCH] [Update] UI: Add VRAM overflow and out of memory error notifications and functions. --- src-ui/logics/_useBackendErrorHandling.js | 43 +++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src-ui/logics/_useBackendErrorHandling.js b/src-ui/logics/_useBackendErrorHandling.js index d5987a1b..053b7d8f 100644 --- a/src-ui/logics/_useBackendErrorHandling.js +++ b/src-ui/logics/_useBackendErrorHandling.js @@ -4,6 +4,10 @@ import { useNotificationStatus, } from "@logics_common"; +import { + useMainFunction, +} from "@logics_main"; + import { useMicRecordTimeout, useMicPhraseTimeout, @@ -24,6 +28,8 @@ export const _useBackendErrorHandling = () => { const { t } = useTranslation(); const { showNotification_Error } = useNotificationStatus(); + const { updateTranslationStatus, updateTranscriptionSendStatus, updateTranscriptionReceiveStatus } = useMainFunction(); + const { updateMicRecordTimeout } = useMicRecordTimeout(); const { updateMicPhraseTimeout } = useMicPhraseTimeout(); const { updateMicMaxWords } = useMicMaxWords(); @@ -70,6 +76,43 @@ export const _useBackendErrorHandling = () => { if (message === "Translation engine limit error") showNotification_Error(t("common_error.translation_limit")); return; + case "/run/enable_translation": + if (message === "Translation disabled due to VRAM overflow") { + updateTranslationStatus(data); + showNotification_Error("Translation disabled due to VRAM overflow"); + } + return; + + case "/run/enable_transcription_send": + if (message === "Transcription send disabled due to VRAM overflow") { + updateTranscriptionSendStatus(data); + showNotification_Error("Transcription send disabled due to VRAM overflow"); + } + return; + + case "/run/enable_transcription_send": + if (message === "Transcription receive disabled due to VRAM overflow") { + updateTranscriptionReceiveStatus(data); + showNotification_Error("Transcription receive disabled due to VRAM overflow"); + } + return; + + case "/run/error_translation_chat_vram_overflow": + if (message === "VRAM out of memory during translation of chat") showNotification_Error("VRAM out of memory during translation of chat"); + return; + case "/run/error_translation_mic_vram_overflow": + if (message === "VRAM out of memory during translation of mic") showNotification_Error("VRAM out of memory during translation of mic"); + return; + case "/run/error_translation_speaker_vram_overflow": + if (message === "VRAM out of memory during translation of speaker") showNotification_Error("VRAM out of memory during translation of speaker"); + return; + case "/run/error_transcription_mic_vram_overflow": + if (message === "VRAM out of memory during mic transcription") showNotification_Error("VRAM out of memory during mic transcription"); + return; + case "/run/error_transcription_speaker_vram_overflow": + if (message === "VRAM out of memory during speaker transcription") showNotification_Error("VRAM out of memory during speaker transcription"); + return; + case "/set/data/deepl_auth_key": if (message === "DeepL auth key length is not correct") { updateDeepLAuthKey(data);