[Refactor] Change aliases and move test_data.js.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useOpenFolder = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useUpdateSoftware = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
useStore_SpeakerThresholdCheckStatus,
|
||||
} from "@store";
|
||||
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useVolume = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_OscIpAddress } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useOscIpAddress = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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 = () => {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MessageLogUiScaling } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMessageLogUiScaling = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// import { useStore_RestoreWindowGeometry } from "@store";
|
||||
// import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
// import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
// export const useRestoreWindowGeometry = () => {
|
||||
// const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedFontFamily } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedFontFamily = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SendMessageButtonType } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSendMessageButtonType = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_Transparency } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useTransparency = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_UiLanguage } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useUiLanguage = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_UiScaling } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useUiScaling = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableAutoMicSelect } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableAutoMicSelect = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableAutoSpeakerSelect } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableAutoSpeakerSelect = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicDeviceList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicDeviceList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicHostList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicHostList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedMicDevice } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedMicDevice = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedMicHost } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedMicHost = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedSpeakerDevice } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedSpeakerDevice = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SpeakerDeviceList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSpeakerDeviceList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableAutoClearMessageInputBox } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableAutoClearMessageInputBox = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableAutoExportMessageLogs } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableAutoExportMessageLogs = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableNotificationVrcSfx } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableNotificationVrcSfx = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableSendMessageToVrc } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableSendMessageToVrc = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableSendOnlyTranslatedMessages } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableSendOnlyTranslatedMessages = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableSendReceivedMessageToVrc } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableSendReceivedMessageToVrc = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_EnableVrcMicMuteSync } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useEnableVrcMicMuteSync = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SendMessageButtonType } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSendMessageButtonType = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicMaxWords } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicMaxWords = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicPhraseTimeout } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicPhraseTimeout = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicRecordTimeout } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicRecordTimeout = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_MicWordFilterList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useMicWordFilterList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectableWhisperComputeDeviceList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectableWhisperComputeDeviceList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedTranscriptionEngine } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedTranscriptionEngine = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedWhisperComputeDevice } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedWhisperComputeDevice = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedWhisperWeightType } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedWhisperWeightType = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SpeakerMaxWords } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSpeakerMaxWords = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SpeakerPhraseTimeout } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSpeakerPhraseTimeout = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SpeakerRecordTimeout } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSpeakerRecordTimeout = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_WhisperWeightTypeStatus } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useWhisperWeightTypeStatus = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_CTranslate2WeightTypeStatus } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useCTranslate2WeightTypeStatus = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectableCTranslate2ComputeDeviceList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedCTranslate2ComputeDevice } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedCTranslate2ComputeDevice = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectedCTranslate2WeightType } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectedCTranslate2WeightType = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_IsEnabledOverlayLargeLog } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useIsEnabledOverlayLargeLog = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_IsEnabledOverlaySmallLog } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useIsEnabledOverlaySmallLog = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_OverlayLargeLogSettings } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useOverlayLargeLogSettings = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_OverlayShowOnlyTranslatedMessages } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useOverlayShowOnlyTranslatedMessages = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_OverlaySmallLogSettings } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useOverlaySmallLogSettings = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSendTextToOverlay = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_IsMainPageCompactMode } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useIsMainPageCompactMode = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useStore_SelectableLanguageList } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
|
||||
export const useSelectableLanguageList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
|
||||
@@ -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 };
|
||||
};
|
||||
Reference in New Issue
Block a user