From 1fcb765ca06bac67a6af6cbd91996e92ca99c633 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Wed, 11 Jun 2025 18:34:13 +0900 Subject: [PATCH] [Refactor] Change aliases and move test_data.js. --- test_data.js => src-ui/_test_data.js | 2 +- .../StartPythonController.jsx | 39 +++++++++++++++++-- src-ui/logics/common/useMessage.js | 2 +- src-ui/logics/common/useOpenFolder.js | 2 +- src-ui/logics/common/useSoftwareVersion.js | 2 +- src-ui/logics/common/useUpdateSoftware.js | 2 +- src-ui/logics/common/useVolume.js | 2 +- src-ui/logics/common/useWindow.js | 2 +- .../advanced_settings/useOscIpAddress.js | 2 +- .../configs/advanced_settings/useOscPort.js | 2 +- .../configs/advanced_settings/useWebsocket.js | 2 +- .../appearance/useMessageLogUiScaling.js | 2 +- .../appearance/useRestoreWindowGeometry.js | 2 +- .../appearance/useSelectedFontFamily.js | 2 +- .../appearance/useSendMessageButtonType.js | 2 +- .../configs/appearance/useTransparency.js | 2 +- .../configs/appearance/useUiLanguage.js | 2 +- .../logics/configs/appearance/useUiScaling.js | 2 +- .../configs/device/useEnableAutoMicSelect.js | 2 +- .../device/useEnableAutoSpeakerSelect.js | 2 +- .../logics/configs/device/useMicDeviceList.js | 2 +- .../logics/configs/device/useMicHostList.js | 2 +- .../logics/configs/device/useMicThreshold.js | 2 +- .../configs/device/useSelectedMicDevice.js | 2 +- .../configs/device/useSelectedMicHost.js | 2 +- .../device/useSelectedSpeakerDevice.js | 2 +- .../configs/device/useSpeakerDeviceList.js | 2 +- .../configs/device/useSpeakerThreshold.js | 2 +- src-ui/logics/configs/hotkeys/useHotkeys.js | 2 +- .../useEnableAutoClearMessageInputBox.js | 2 +- .../others/useEnableAutoExportMessageLogs.js | 2 +- .../others/useEnableNotificationVrcSfx.js | 2 +- .../others/useEnableSendMessageToVrc.js | 2 +- .../useEnableSendOnlyTranslatedMessages.js | 2 +- .../useEnableSendReceivedMessageToVrc.js | 2 +- .../configs/others/useEnableVrcMicMuteSync.js | 2 +- .../others/useSendMessageButtonType.js | 2 +- src-ui/logics/configs/plugins/usePlugins.js | 2 +- .../configs/transcription/useMicMaxWords.js | 2 +- .../transcription/useMicPhraseTimeout.js | 2 +- .../transcription/useMicRecordTimeout.js | 2 +- .../transcription/useMicWordFilterList.js | 2 +- .../useSelectableWhisperComputeDeviceList.js | 2 +- .../useSelectedTranscriptionEngine.js | 2 +- .../useSelectedWhisperComputeDevice.js | 2 +- .../useSelectedWhisperWeightType.js | 2 +- .../transcription/useSpeakerMaxWords.js | 2 +- .../transcription/useSpeakerPhraseTimeout.js | 2 +- .../transcription/useSpeakerRecordTimeout.js | 2 +- .../useWhisperWeightTypeStatus.js | 2 +- .../useCTranslate2WeightTypeStatus.js | 2 +- .../configs/translation/useDeepLAuthKey.js | 2 +- ...eSelectableCTranslate2ComputeDeviceList.js | 2 +- .../useSelectedCTranslate2ComputeDevice.js | 2 +- .../useSelectedCTranslate2WeightType.js | 2 +- .../configs/vr/useIsEnabledOverlayLargeLog.js | 2 +- .../configs/vr/useIsEnabledOverlaySmallLog.js | 2 +- .../configs/vr/useOverlayLargeLogSettings.js | 2 +- .../useOverlayShowOnlyTranslatedMessages.js | 2 +- .../configs/vr/useOverlaySmallLogSettings.js | 2 +- .../logics/configs/vr/useSendTextToOverlay.js | 2 +- .../logics/main/useIsMainPageCompactMode.js | 2 +- src-ui/logics/main/useLanguageSettings.js | 2 +- src-ui/logics/main/useMainFunction.js | 2 +- src-ui/logics/main/useMessageInputBoxRatio.js | 2 +- .../logics/main/useSelectableLanguageList.js | 2 +- src-ui/logics/useStartPython.js | 34 ---------------- src-ui/store.js | 7 ++-- vite.config.js | 4 +- 69 files changed, 108 insertions(+), 106 deletions(-) rename test_data.js => src-ui/_test_data.js (95%) delete mode 100644 src-ui/logics/useStartPython.js diff --git a/test_data.js b/src-ui/_test_data.js similarity index 95% rename from test_data.js rename to src-ui/_test_data.js index ba53cb7e..d2e1723c 100644 --- a/test_data.js +++ b/src-ui/_test_data.js @@ -1,4 +1,4 @@ -export const generateTestData = (num) => { +export const generateTestConversationData = (num) => { const testDataArray = []; const messagesJa = [ "今日はとてもいい天気ですね。", diff --git a/src-ui/app/_app_controllers/StartPythonController.jsx b/src-ui/app/_app_controllers/StartPythonController.jsx index c351120c..55824bc8 100644 --- a/src-ui/app/_app_controllers/StartPythonController.jsx +++ b/src-ui/app/_app_controllers/StartPythonController.jsx @@ -1,11 +1,16 @@ import { invoke } from "@tauri-apps/api/core"; +import { Command } from "@tauri-apps/plugin-shell"; import { useEffect, useRef } from "react"; -import { useStartPython } from "@logics/useStartPython"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; -import { useStore_SelectableFontFamilyList } from "@store"; +import { useStdoutToPython } from "@useStdoutToPython"; +import { useReceiveRoutes } from "@useReceiveRoutes"; +import { store, useStore_SelectableFontFamilyList } from "@store"; import { arrayToObject } from "@utils"; +import { + useNotificationStatus, +} from "@logics_common"; + export const StartPythonController = () => { const { asyncStartPython } = useStartPython(); const hasRunRef = useRef(false); @@ -26,6 +31,34 @@ export const StartPythonController = () => { return null; }; +const useStartPython = () => { + const { receiveRoutes } = useReceiveRoutes(); + const { showNotification_Success, showNotification_Error } = useNotificationStatus(); + + const asyncStartPython = async () => { + const command = Command.sidecar("bin/VRCT-sidecar"); + command.on("error", error => console.error(`error: "${error}"`)); + command.stdout.on("data", (line) => { + let parsed_data = ""; + try { + parsed_data = JSON.parse(line); + receiveRoutes(parsed_data); + } catch (error) { + console.log(error, line); + } + }); + command.stderr.on("data", line => { + showNotification_Error( + `An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null }); + console.error("stderr", line); + }); + const backend_subprocess = await command.spawn(); + store.backend_subprocess = backend_subprocess; + }; + + return { asyncStartPython }; +}; + const useAsyncFetchFonts = () => { const { updateSelectableFontFamilyList } = useStore_SelectableFontFamilyList(); const asyncFetchFonts = async () => { diff --git a/src-ui/logics/common/useMessage.js b/src-ui/logics/common/useMessage.js index 416555a6..841c90dc 100644 --- a/src-ui/logics/common/useMessage.js +++ b/src-ui/logics/common/useMessage.js @@ -3,7 +3,7 @@ import { useStore_MessageInputValue, } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMessage = () => { const { currentMessageLogs, addMessageLogs, updateMessageLogs } = useStore_MessageLogs(); diff --git a/src-ui/logics/common/useOpenFolder.js b/src-ui/logics/common/useOpenFolder.js index 202ef5ad..fa991f03 100644 --- a/src-ui/logics/common/useOpenFolder.js +++ b/src-ui/logics/common/useOpenFolder.js @@ -1,4 +1,4 @@ -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useOpenFolder = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/common/useSoftwareVersion.js b/src-ui/logics/common/useSoftwareVersion.js index 18f24a7f..25c257d5 100644 --- a/src-ui/logics/common/useSoftwareVersion.js +++ b/src-ui/logics/common/useSoftwareVersion.js @@ -1,7 +1,7 @@ import semver from "semver"; import { useStore_SoftwareVersion, useStore_LatestSoftwareVersionInfo } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSoftwareVersion = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/common/useUpdateSoftware.js b/src-ui/logics/common/useUpdateSoftware.js index f3d2f1cf..208cbf30 100644 --- a/src-ui/logics/common/useUpdateSoftware.js +++ b/src-ui/logics/common/useUpdateSoftware.js @@ -1,4 +1,4 @@ -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useUpdateSoftware = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/common/useVolume.js b/src-ui/logics/common/useVolume.js index b3e2165b..ce94a391 100644 --- a/src-ui/logics/common/useVolume.js +++ b/src-ui/logics/common/useVolume.js @@ -5,7 +5,7 @@ import { useStore_SpeakerThresholdCheckStatus, } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useVolume = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/common/useWindow.js b/src-ui/logics/common/useWindow.js index 88182dd6..9585d0df 100644 --- a/src-ui/logics/common/useWindow.js +++ b/src-ui/logics/common/useWindow.js @@ -1,6 +1,6 @@ import { useEffect, useRef } from "react"; import { currentMonitor, availableMonitors, PhysicalPosition, PhysicalSize } from "@tauri-apps/api/window"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { useStore_IsBreakPoint } from "@store"; import { useUiScaling } from "@logics_configs"; import { store } from "@store"; diff --git a/src-ui/logics/configs/advanced_settings/useOscIpAddress.js b/src-ui/logics/configs/advanced_settings/useOscIpAddress.js index 702a6d98..8fe1ae06 100644 --- a/src-ui/logics/configs/advanced_settings/useOscIpAddress.js +++ b/src-ui/logics/configs/advanced_settings/useOscIpAddress.js @@ -1,5 +1,5 @@ import { useStore_OscIpAddress } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useOscIpAddress = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/advanced_settings/useOscPort.js b/src-ui/logics/configs/advanced_settings/useOscPort.js index d3e28557..0710021c 100644 --- a/src-ui/logics/configs/advanced_settings/useOscPort.js +++ b/src-ui/logics/configs/advanced_settings/useOscPort.js @@ -1,5 +1,5 @@ import { useStore_OscPort } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { useNotificationStatus } from "@logics_common"; export const useOscPort = () => { diff --git a/src-ui/logics/configs/advanced_settings/useWebsocket.js b/src-ui/logics/configs/advanced_settings/useWebsocket.js index 51361489..2002b78d 100644 --- a/src-ui/logics/configs/advanced_settings/useWebsocket.js +++ b/src-ui/logics/configs/advanced_settings/useWebsocket.js @@ -3,7 +3,7 @@ import { useStore_WebsocketHost, useStore_WebsocketPort, } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useWebsocket = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useMessageLogUiScaling.js b/src-ui/logics/configs/appearance/useMessageLogUiScaling.js index 625f6263..2833774f 100644 --- a/src-ui/logics/configs/appearance/useMessageLogUiScaling.js +++ b/src-ui/logics/configs/appearance/useMessageLogUiScaling.js @@ -1,5 +1,5 @@ import { useStore_MessageLogUiScaling } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMessageLogUiScaling = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useRestoreWindowGeometry.js b/src-ui/logics/configs/appearance/useRestoreWindowGeometry.js index 2cc618be..76a01a4b 100644 --- a/src-ui/logics/configs/appearance/useRestoreWindowGeometry.js +++ b/src-ui/logics/configs/appearance/useRestoreWindowGeometry.js @@ -1,5 +1,5 @@ // import { useStore_RestoreWindowGeometry } from "@store"; -// import { useStdoutToPython } from "@logics/useStdoutToPython"; +// import { useStdoutToPython } from "@useStdoutToPython"; // export const useRestoreWindowGeometry = () => { // const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useSelectedFontFamily.js b/src-ui/logics/configs/appearance/useSelectedFontFamily.js index bfb43029..538ef462 100644 --- a/src-ui/logics/configs/appearance/useSelectedFontFamily.js +++ b/src-ui/logics/configs/appearance/useSelectedFontFamily.js @@ -1,5 +1,5 @@ import { useStore_SelectedFontFamily } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedFontFamily = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useSendMessageButtonType.js b/src-ui/logics/configs/appearance/useSendMessageButtonType.js index f69a51f2..e92c9b21 100644 --- a/src-ui/logics/configs/appearance/useSendMessageButtonType.js +++ b/src-ui/logics/configs/appearance/useSendMessageButtonType.js @@ -1,5 +1,5 @@ import { useStore_SendMessageButtonType } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSendMessageButtonType = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useTransparency.js b/src-ui/logics/configs/appearance/useTransparency.js index 9ab7429f..4c719503 100644 --- a/src-ui/logics/configs/appearance/useTransparency.js +++ b/src-ui/logics/configs/appearance/useTransparency.js @@ -1,5 +1,5 @@ import { useStore_Transparency } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useTransparency = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useUiLanguage.js b/src-ui/logics/configs/appearance/useUiLanguage.js index 149a8fb3..bb3a5b39 100644 --- a/src-ui/logics/configs/appearance/useUiLanguage.js +++ b/src-ui/logics/configs/appearance/useUiLanguage.js @@ -1,5 +1,5 @@ import { useStore_UiLanguage } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useUiLanguage = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/appearance/useUiScaling.js b/src-ui/logics/configs/appearance/useUiScaling.js index 501118f1..e5d75e1d 100644 --- a/src-ui/logics/configs/appearance/useUiScaling.js +++ b/src-ui/logics/configs/appearance/useUiScaling.js @@ -1,5 +1,5 @@ import { useStore_UiScaling } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useUiScaling = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useEnableAutoMicSelect.js b/src-ui/logics/configs/device/useEnableAutoMicSelect.js index 1370d055..c9f7e5d6 100644 --- a/src-ui/logics/configs/device/useEnableAutoMicSelect.js +++ b/src-ui/logics/configs/device/useEnableAutoMicSelect.js @@ -1,5 +1,5 @@ import { useStore_EnableAutoMicSelect } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableAutoMicSelect = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useEnableAutoSpeakerSelect.js b/src-ui/logics/configs/device/useEnableAutoSpeakerSelect.js index d43184de..406cbf25 100644 --- a/src-ui/logics/configs/device/useEnableAutoSpeakerSelect.js +++ b/src-ui/logics/configs/device/useEnableAutoSpeakerSelect.js @@ -1,5 +1,5 @@ import { useStore_EnableAutoSpeakerSelect } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableAutoSpeakerSelect = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useMicDeviceList.js b/src-ui/logics/configs/device/useMicDeviceList.js index 196b32cf..486c3f58 100644 --- a/src-ui/logics/configs/device/useMicDeviceList.js +++ b/src-ui/logics/configs/device/useMicDeviceList.js @@ -1,5 +1,5 @@ import { useStore_MicDeviceList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicDeviceList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useMicHostList.js b/src-ui/logics/configs/device/useMicHostList.js index ed61f80a..39d34097 100644 --- a/src-ui/logics/configs/device/useMicHostList.js +++ b/src-ui/logics/configs/device/useMicHostList.js @@ -1,5 +1,5 @@ import { useStore_MicHostList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicHostList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useMicThreshold.js b/src-ui/logics/configs/device/useMicThreshold.js index ab6bda6c..a6224c38 100644 --- a/src-ui/logics/configs/device/useMicThreshold.js +++ b/src-ui/logics/configs/device/useMicThreshold.js @@ -1,5 +1,5 @@ import { useStore_MicThreshold, useStore_EnableAutomaticMicThreshold } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicThreshold = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useSelectedMicDevice.js b/src-ui/logics/configs/device/useSelectedMicDevice.js index 798eae5a..6bd7d11a 100644 --- a/src-ui/logics/configs/device/useSelectedMicDevice.js +++ b/src-ui/logics/configs/device/useSelectedMicDevice.js @@ -1,5 +1,5 @@ import { useStore_SelectedMicDevice } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedMicDevice = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useSelectedMicHost.js b/src-ui/logics/configs/device/useSelectedMicHost.js index 0ef9c882..f1c1c147 100644 --- a/src-ui/logics/configs/device/useSelectedMicHost.js +++ b/src-ui/logics/configs/device/useSelectedMicHost.js @@ -1,5 +1,5 @@ import { useStore_SelectedMicHost } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedMicHost = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useSelectedSpeakerDevice.js b/src-ui/logics/configs/device/useSelectedSpeakerDevice.js index b8d85693..672a9267 100644 --- a/src-ui/logics/configs/device/useSelectedSpeakerDevice.js +++ b/src-ui/logics/configs/device/useSelectedSpeakerDevice.js @@ -1,5 +1,5 @@ import { useStore_SelectedSpeakerDevice } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedSpeakerDevice = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useSpeakerDeviceList.js b/src-ui/logics/configs/device/useSpeakerDeviceList.js index 2848111c..b0385cf8 100644 --- a/src-ui/logics/configs/device/useSpeakerDeviceList.js +++ b/src-ui/logics/configs/device/useSpeakerDeviceList.js @@ -1,5 +1,5 @@ import { useStore_SpeakerDeviceList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSpeakerDeviceList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/device/useSpeakerThreshold.js b/src-ui/logics/configs/device/useSpeakerThreshold.js index 29824b01..c21fe2ef 100644 --- a/src-ui/logics/configs/device/useSpeakerThreshold.js +++ b/src-ui/logics/configs/device/useSpeakerThreshold.js @@ -1,5 +1,5 @@ import { useStore_SpeakerThreshold, useStore_EnableAutomaticSpeakerThreshold } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSpeakerThreshold = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/hotkeys/useHotkeys.js b/src-ui/logics/configs/hotkeys/useHotkeys.js index a2bbe35d..20b18732 100644 --- a/src-ui/logics/configs/hotkeys/useHotkeys.js +++ b/src-ui/logics/configs/hotkeys/useHotkeys.js @@ -1,5 +1,5 @@ import { store, useStore_Hotkeys } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { useNotificationStatus } from "@logics_common"; import { useMainFunction } from "@logics_main"; import { register, unregisterAll, isRegistered } from "@tauri-apps/plugin-global-shortcut"; diff --git a/src-ui/logics/configs/others/useEnableAutoClearMessageInputBox.js b/src-ui/logics/configs/others/useEnableAutoClearMessageInputBox.js index d04c6094..6508990c 100644 --- a/src-ui/logics/configs/others/useEnableAutoClearMessageInputBox.js +++ b/src-ui/logics/configs/others/useEnableAutoClearMessageInputBox.js @@ -1,5 +1,5 @@ import { useStore_EnableAutoClearMessageInputBox } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableAutoClearMessageInputBox = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableAutoExportMessageLogs.js b/src-ui/logics/configs/others/useEnableAutoExportMessageLogs.js index 8249a83a..e9faab35 100644 --- a/src-ui/logics/configs/others/useEnableAutoExportMessageLogs.js +++ b/src-ui/logics/configs/others/useEnableAutoExportMessageLogs.js @@ -1,5 +1,5 @@ import { useStore_EnableAutoExportMessageLogs } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableAutoExportMessageLogs = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js b/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js index 24e1096a..9a001114 100644 --- a/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js +++ b/src-ui/logics/configs/others/useEnableNotificationVrcSfx.js @@ -1,5 +1,5 @@ import { useStore_EnableNotificationVrcSfx } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableNotificationVrcSfx = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableSendMessageToVrc.js b/src-ui/logics/configs/others/useEnableSendMessageToVrc.js index 10ef4b0c..6284dd17 100644 --- a/src-ui/logics/configs/others/useEnableSendMessageToVrc.js +++ b/src-ui/logics/configs/others/useEnableSendMessageToVrc.js @@ -1,5 +1,5 @@ import { useStore_EnableSendMessageToVrc } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableSendMessageToVrc = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableSendOnlyTranslatedMessages.js b/src-ui/logics/configs/others/useEnableSendOnlyTranslatedMessages.js index 7e9abefb..4ba9d4af 100644 --- a/src-ui/logics/configs/others/useEnableSendOnlyTranslatedMessages.js +++ b/src-ui/logics/configs/others/useEnableSendOnlyTranslatedMessages.js @@ -1,5 +1,5 @@ import { useStore_EnableSendOnlyTranslatedMessages } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableSendOnlyTranslatedMessages = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableSendReceivedMessageToVrc.js b/src-ui/logics/configs/others/useEnableSendReceivedMessageToVrc.js index 5eeeb102..bfc550a1 100644 --- a/src-ui/logics/configs/others/useEnableSendReceivedMessageToVrc.js +++ b/src-ui/logics/configs/others/useEnableSendReceivedMessageToVrc.js @@ -1,5 +1,5 @@ import { useStore_EnableSendReceivedMessageToVrc } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableSendReceivedMessageToVrc = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useEnableVrcMicMuteSync.js b/src-ui/logics/configs/others/useEnableVrcMicMuteSync.js index 6515ffc2..f8711d81 100644 --- a/src-ui/logics/configs/others/useEnableVrcMicMuteSync.js +++ b/src-ui/logics/configs/others/useEnableVrcMicMuteSync.js @@ -1,5 +1,5 @@ import { useStore_EnableVrcMicMuteSync } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useEnableVrcMicMuteSync = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/others/useSendMessageButtonType.js b/src-ui/logics/configs/others/useSendMessageButtonType.js index a6a22add..621c7dbc 100644 --- a/src-ui/logics/configs/others/useSendMessageButtonType.js +++ b/src-ui/logics/configs/others/useSendMessageButtonType.js @@ -1,5 +1,5 @@ import { useStore_SendMessageButtonType } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSendMessageButtonType = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/plugins/usePlugins.js b/src-ui/logics/configs/plugins/usePlugins.js index d4d398fa..50a9fe41 100644 --- a/src-ui/logics/configs/plugins/usePlugins.js +++ b/src-ui/logics/configs/plugins/usePlugins.js @@ -11,7 +11,7 @@ import { useStore_FetchedPluginsInfo, useStore_LoadedPlugins, } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { transform } from "@babel/standalone"; import { writeFile, mkdir, exists, remove, readDir, BaseDirectory, readTextFile } from "@tauri-apps/plugin-fs"; diff --git a/src-ui/logics/configs/transcription/useMicMaxWords.js b/src-ui/logics/configs/transcription/useMicMaxWords.js index 7415d655..72abd77b 100644 --- a/src-ui/logics/configs/transcription/useMicMaxWords.js +++ b/src-ui/logics/configs/transcription/useMicMaxWords.js @@ -1,5 +1,5 @@ import { useStore_MicMaxWords } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicMaxWords = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useMicPhraseTimeout.js b/src-ui/logics/configs/transcription/useMicPhraseTimeout.js index 02601b0c..6f66abf8 100644 --- a/src-ui/logics/configs/transcription/useMicPhraseTimeout.js +++ b/src-ui/logics/configs/transcription/useMicPhraseTimeout.js @@ -1,5 +1,5 @@ import { useStore_MicPhraseTimeout } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicPhraseTimeout = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useMicRecordTimeout.js b/src-ui/logics/configs/transcription/useMicRecordTimeout.js index 27798804..cfeab807 100644 --- a/src-ui/logics/configs/transcription/useMicRecordTimeout.js +++ b/src-ui/logics/configs/transcription/useMicRecordTimeout.js @@ -1,5 +1,5 @@ import { useStore_MicRecordTimeout } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicRecordTimeout = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useMicWordFilterList.js b/src-ui/logics/configs/transcription/useMicWordFilterList.js index cca40b0a..a0ac5b09 100644 --- a/src-ui/logics/configs/transcription/useMicWordFilterList.js +++ b/src-ui/logics/configs/transcription/useMicWordFilterList.js @@ -1,5 +1,5 @@ import { useStore_MicWordFilterList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMicWordFilterList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSelectableWhisperComputeDeviceList.js b/src-ui/logics/configs/transcription/useSelectableWhisperComputeDeviceList.js index 94ae24f6..2c732651 100644 --- a/src-ui/logics/configs/transcription/useSelectableWhisperComputeDeviceList.js +++ b/src-ui/logics/configs/transcription/useSelectableWhisperComputeDeviceList.js @@ -1,5 +1,5 @@ import { useStore_SelectableWhisperComputeDeviceList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectableWhisperComputeDeviceList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSelectedTranscriptionEngine.js b/src-ui/logics/configs/transcription/useSelectedTranscriptionEngine.js index 43f0b6ab..9c7758f7 100644 --- a/src-ui/logics/configs/transcription/useSelectedTranscriptionEngine.js +++ b/src-ui/logics/configs/transcription/useSelectedTranscriptionEngine.js @@ -1,5 +1,5 @@ import { useStore_SelectedTranscriptionEngine } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedTranscriptionEngine = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSelectedWhisperComputeDevice.js b/src-ui/logics/configs/transcription/useSelectedWhisperComputeDevice.js index f2d34af1..517dde00 100644 --- a/src-ui/logics/configs/transcription/useSelectedWhisperComputeDevice.js +++ b/src-ui/logics/configs/transcription/useSelectedWhisperComputeDevice.js @@ -1,5 +1,5 @@ import { useStore_SelectedWhisperComputeDevice } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedWhisperComputeDevice = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSelectedWhisperWeightType.js b/src-ui/logics/configs/transcription/useSelectedWhisperWeightType.js index 02993646..220921ae 100644 --- a/src-ui/logics/configs/transcription/useSelectedWhisperWeightType.js +++ b/src-ui/logics/configs/transcription/useSelectedWhisperWeightType.js @@ -1,5 +1,5 @@ import { useStore_SelectedWhisperWeightType } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedWhisperWeightType = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSpeakerMaxWords.js b/src-ui/logics/configs/transcription/useSpeakerMaxWords.js index 8678ceb2..4907ab09 100644 --- a/src-ui/logics/configs/transcription/useSpeakerMaxWords.js +++ b/src-ui/logics/configs/transcription/useSpeakerMaxWords.js @@ -1,5 +1,5 @@ import { useStore_SpeakerMaxWords } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSpeakerMaxWords = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSpeakerPhraseTimeout.js b/src-ui/logics/configs/transcription/useSpeakerPhraseTimeout.js index af9e8fba..4f9ac1c9 100644 --- a/src-ui/logics/configs/transcription/useSpeakerPhraseTimeout.js +++ b/src-ui/logics/configs/transcription/useSpeakerPhraseTimeout.js @@ -1,5 +1,5 @@ import { useStore_SpeakerPhraseTimeout } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSpeakerPhraseTimeout = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useSpeakerRecordTimeout.js b/src-ui/logics/configs/transcription/useSpeakerRecordTimeout.js index 5d17754c..123ad89b 100644 --- a/src-ui/logics/configs/transcription/useSpeakerRecordTimeout.js +++ b/src-ui/logics/configs/transcription/useSpeakerRecordTimeout.js @@ -1,5 +1,5 @@ import { useStore_SpeakerRecordTimeout } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSpeakerRecordTimeout = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/transcription/useWhisperWeightTypeStatus.js b/src-ui/logics/configs/transcription/useWhisperWeightTypeStatus.js index 482273d2..1d8a96c3 100644 --- a/src-ui/logics/configs/transcription/useWhisperWeightTypeStatus.js +++ b/src-ui/logics/configs/transcription/useWhisperWeightTypeStatus.js @@ -1,5 +1,5 @@ import { useStore_WhisperWeightTypeStatus } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useWhisperWeightTypeStatus = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/translation/useCTranslate2WeightTypeStatus.js b/src-ui/logics/configs/translation/useCTranslate2WeightTypeStatus.js index 4f840765..fa28404e 100644 --- a/src-ui/logics/configs/translation/useCTranslate2WeightTypeStatus.js +++ b/src-ui/logics/configs/translation/useCTranslate2WeightTypeStatus.js @@ -1,5 +1,5 @@ import { useStore_CTranslate2WeightTypeStatus } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useCTranslate2WeightTypeStatus = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/translation/useDeepLAuthKey.js b/src-ui/logics/configs/translation/useDeepLAuthKey.js index a568dfe9..bff8163b 100644 --- a/src-ui/logics/configs/translation/useDeepLAuthKey.js +++ b/src-ui/logics/configs/translation/useDeepLAuthKey.js @@ -1,5 +1,5 @@ import { useStore_DeepLAuthKey } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { useTranslation } from "react-i18next"; import { useNotificationStatus } from "@logics_common"; diff --git a/src-ui/logics/configs/translation/useSelectableCTranslate2ComputeDeviceList.js b/src-ui/logics/configs/translation/useSelectableCTranslate2ComputeDeviceList.js index e2ca89ca..db576d9c 100644 --- a/src-ui/logics/configs/translation/useSelectableCTranslate2ComputeDeviceList.js +++ b/src-ui/logics/configs/translation/useSelectableCTranslate2ComputeDeviceList.js @@ -1,5 +1,5 @@ import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectableCTranslate2ComputeDeviceList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/translation/useSelectedCTranslate2ComputeDevice.js b/src-ui/logics/configs/translation/useSelectedCTranslate2ComputeDevice.js index 37f6623d..0887364d 100644 --- a/src-ui/logics/configs/translation/useSelectedCTranslate2ComputeDevice.js +++ b/src-ui/logics/configs/translation/useSelectedCTranslate2ComputeDevice.js @@ -1,5 +1,5 @@ import { useStore_SelectedCTranslate2ComputeDevice } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedCTranslate2ComputeDevice = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/translation/useSelectedCTranslate2WeightType.js b/src-ui/logics/configs/translation/useSelectedCTranslate2WeightType.js index 8641a2ac..9b6197dc 100644 --- a/src-ui/logics/configs/translation/useSelectedCTranslate2WeightType.js +++ b/src-ui/logics/configs/translation/useSelectedCTranslate2WeightType.js @@ -1,5 +1,5 @@ import { useStore_SelectedCTranslate2WeightType } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectedCTranslate2WeightType = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useIsEnabledOverlayLargeLog.js b/src-ui/logics/configs/vr/useIsEnabledOverlayLargeLog.js index 0e1f8881..c66e865f 100644 --- a/src-ui/logics/configs/vr/useIsEnabledOverlayLargeLog.js +++ b/src-ui/logics/configs/vr/useIsEnabledOverlayLargeLog.js @@ -1,5 +1,5 @@ import { useStore_IsEnabledOverlayLargeLog } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useIsEnabledOverlayLargeLog = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useIsEnabledOverlaySmallLog.js b/src-ui/logics/configs/vr/useIsEnabledOverlaySmallLog.js index e51a34c3..dbdf0247 100644 --- a/src-ui/logics/configs/vr/useIsEnabledOverlaySmallLog.js +++ b/src-ui/logics/configs/vr/useIsEnabledOverlaySmallLog.js @@ -1,5 +1,5 @@ import { useStore_IsEnabledOverlaySmallLog } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useIsEnabledOverlaySmallLog = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useOverlayLargeLogSettings.js b/src-ui/logics/configs/vr/useOverlayLargeLogSettings.js index 548189e3..f7a1a577 100644 --- a/src-ui/logics/configs/vr/useOverlayLargeLogSettings.js +++ b/src-ui/logics/configs/vr/useOverlayLargeLogSettings.js @@ -1,5 +1,5 @@ import { useStore_OverlayLargeLogSettings } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useOverlayLargeLogSettings = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useOverlayShowOnlyTranslatedMessages.js b/src-ui/logics/configs/vr/useOverlayShowOnlyTranslatedMessages.js index 895581ae..40e3fc87 100644 --- a/src-ui/logics/configs/vr/useOverlayShowOnlyTranslatedMessages.js +++ b/src-ui/logics/configs/vr/useOverlayShowOnlyTranslatedMessages.js @@ -1,5 +1,5 @@ import { useStore_OverlayShowOnlyTranslatedMessages } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useOverlayShowOnlyTranslatedMessages = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useOverlaySmallLogSettings.js b/src-ui/logics/configs/vr/useOverlaySmallLogSettings.js index 03b61393..7979f5c1 100644 --- a/src-ui/logics/configs/vr/useOverlaySmallLogSettings.js +++ b/src-ui/logics/configs/vr/useOverlaySmallLogSettings.js @@ -1,5 +1,5 @@ import { useStore_OverlaySmallLogSettings } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useOverlaySmallLogSettings = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/configs/vr/useSendTextToOverlay.js b/src-ui/logics/configs/vr/useSendTextToOverlay.js index 268881ec..f109e3ad 100644 --- a/src-ui/logics/configs/vr/useSendTextToOverlay.js +++ b/src-ui/logics/configs/vr/useSendTextToOverlay.js @@ -1,4 +1,4 @@ -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSendTextToOverlay = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/main/useIsMainPageCompactMode.js b/src-ui/logics/main/useIsMainPageCompactMode.js index 9a883c51..a1c7110f 100644 --- a/src-ui/logics/main/useIsMainPageCompactMode.js +++ b/src-ui/logics/main/useIsMainPageCompactMode.js @@ -1,5 +1,5 @@ import { useStore_IsMainPageCompactMode } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useIsMainPageCompactMode = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/main/useLanguageSettings.js b/src-ui/logics/main/useLanguageSettings.js index 163f9f37..dcee9bcf 100644 --- a/src-ui/logics/main/useLanguageSettings.js +++ b/src-ui/logics/main/useLanguageSettings.js @@ -1,5 +1,5 @@ import { useStore_SelectedPresetTabNumber, useStore_EnableMultiTranslation, useStore_SelectedYourLanguages, useStore_SelectedTargetLanguages, useStore_TranslationEngines, useStore_SelectedTranslationEngines } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useLanguageSettings = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/main/useMainFunction.js b/src-ui/logics/main/useMainFunction.js index 05be0662..334ef643 100644 --- a/src-ui/logics/main/useMainFunction.js +++ b/src-ui/logics/main/useMainFunction.js @@ -6,7 +6,7 @@ import { useStore_TranscriptionReceiveStatus, useStore_ForegroundStatus, } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useMainFunction = () => { const appWindow = store.appWindow; diff --git a/src-ui/logics/main/useMessageInputBoxRatio.js b/src-ui/logics/main/useMessageInputBoxRatio.js index b8f8430c..173219d6 100644 --- a/src-ui/logics/main/useMessageInputBoxRatio.js +++ b/src-ui/logics/main/useMessageInputBoxRatio.js @@ -1,6 +1,6 @@ import { store } from "@store"; import { useStore_MessageInputBoxRatio } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; import { clampMinMax } from "@utils"; export const useMessageInputBoxRatio = () => { const appWindow = store.appWindow; diff --git a/src-ui/logics/main/useSelectableLanguageList.js b/src-ui/logics/main/useSelectableLanguageList.js index ef771d7f..094530c8 100644 --- a/src-ui/logics/main/useSelectableLanguageList.js +++ b/src-ui/logics/main/useSelectableLanguageList.js @@ -1,5 +1,5 @@ import { useStore_SelectableLanguageList } from "@store"; -import { useStdoutToPython } from "@logics/useStdoutToPython"; +import { useStdoutToPython } from "@useStdoutToPython"; export const useSelectableLanguageList = () => { const { asyncStdoutToPython } = useStdoutToPython(); diff --git a/src-ui/logics/useStartPython.js b/src-ui/logics/useStartPython.js deleted file mode 100644 index c8aaf2f5..00000000 --- a/src-ui/logics/useStartPython.js +++ /dev/null @@ -1,34 +0,0 @@ -import { Command } from "@tauri-apps/plugin-shell"; -import { store } from "@store"; -import { useReceiveRoutes } from "./useReceiveRoutes"; -import { - useNotificationStatus, -} from "@logics_common"; - -export const useStartPython = () => { - const { receiveRoutes } = useReceiveRoutes(); - const { showNotification_Success, showNotification_Error } = useNotificationStatus(); - - const asyncStartPython = async () => { - const command = Command.sidecar("bin/VRCT-sidecar"); - command.on("error", error => console.error(`error: "${error}"`)); - command.stdout.on("data", (line) => { - let parsed_data = ""; - try { - parsed_data = JSON.parse(line); - receiveRoutes(parsed_data); - } catch (error) { - console.log(error, line); - } - }); - command.stderr.on("data", line => { - showNotification_Error( - `An error occurred. Please restart VRCT or contact the developers. The last line:${JSON.stringify(line)}`, { hide_duration: null }); - console.error("stderr", line) - }); - const backend_subprocess = await command.spawn(); - store.backend_subprocess = backend_subprocess; - }; - - return { asyncStartPython }; -}; \ No newline at end of file diff --git a/src-ui/store.js b/src-ui/store.js index 06fc859a..fcd4c0fd 100644 --- a/src-ui/store.js +++ b/src-ui/store.js @@ -5,8 +5,9 @@ import { } from "jotai"; import { - generateTestData, -} from "@test_data"; + generateTestConversationData, +} from "./_test_data.js" + import { translator_status, ctranslate2_weight_type_status, @@ -169,7 +170,7 @@ export const { atomInstance: Atom_SelectableLanguageList, useHook: useStore_Sele // Message Container export const { atomInstance: Atom_MessageLogs, useHook: useStore_MessageLogs } = createAtomWithHook([], "MessageLogs"); -// export const { atomInstance: Atom_MessageLogs, useHook: useStore_MessageLogs } = createAtomWithHook(generateTestData(20), "MessageLogs"); // For testing +// export const { atomInstance: Atom_MessageLogs, useHook: useStore_MessageLogs } = createAtomWithHook(generateTestConversationData(20), "MessageLogs"); // For testing export const { atomInstance: Atom_MessageInputBoxRatio, useHook: useStore_MessageInputBoxRatio } = createAtomWithHook(20, "MessageInputBoxRatio"); export const { atomInstance: Atom_MessageInputValue, useHook: useStore_MessageInputValue } = createAtomWithHook("", "MessageInputValue"); export const { atomInstance: Atom_IsVisibleResendButton, useHook: useStore_IsVisibleResendButton } = createAtomWithHook(false, "IsVisibleResendButton", {is_state_ok: true}); diff --git a/vite.config.js b/vite.config.js index 092db909..32bd2c51 100644 --- a/vite.config.js +++ b/vite.config.js @@ -56,7 +56,9 @@ export default defineConfig(async () => { resolve: { alias: { "@root": path.resolve(__dirname), - "@test_data": path.resolve(__dirname, "./test_data.js"), + + "@useReceiveRoutes": path.resolve(__dirname, "src-ui/logics/useReceiveRoutes.js"), + "@useStdoutToPython": path.resolve(__dirname, "src-ui/logics/useStdoutToPython.js"), "@ui_configs": path.resolve(__dirname, "src-ui/ui_configs.js"), "@scss_mixins": path.resolve(__dirname, "src-ui/common_css/mixins.scss"),