[Refactor] (Huge Refactoring) ReceiveRoutes: change the way define endpoints, hooks and methods.

Remove 'multi language translation enable/disable' related methods that is no longer in use from quite ago.
This commit is contained in:
Sakamoto Shiina
2025-06-14 01:07:12 +09:00
parent 1fcb765ca0
commit fb2b224231
22 changed files with 510 additions and 609 deletions

View File

@@ -7,7 +7,10 @@ export const useHandleOscQuery = () => {
const { showNotification_Warning } = useNotificationStatus();
const { updateEnableVrcMicMuteSync } = useEnableVrcMicMuteSync();
const handleOscQuery = ({ is_osc_query_enabled, disabled_functions }) => {
const handleOscQuery = (payload) => {
const is_osc_query_enabled = payload.data;
const disabled_functions = payload.disabled_functions;
if (is_osc_query_enabled) {
updateEnableVrcMicMuteSync(prev => ({
...prev.data,

View File

@@ -1,10 +1,21 @@
import { useStore_IsVrctAvailable } from "@store";
import { useNotificationStatus } from "@logics_common";
export const useIsVrctAvailable = () => {
const { currentIsVrctAvailable, updateIsVrctAvailable } = useStore_IsVrctAvailable();
const { showNotification_Success, showNotification_Error } = useNotificationStatus();
const handleAiModelsAvailability = (is_ai_models_available) => {
if (is_ai_models_available === false) {
updateIsVrctAvailable(false);
showNotification_Error("AI models have not been detected. Check the network connection and restart VRCT (it will download automatically, normally).", { hide_duration: null });
}
};
return {
currentIsVrctAvailable,
updateIsVrctAvailable,
handleAiModelsAvailability,
};
};

View File

@@ -42,6 +42,9 @@ export const useMessage = () => {
messages: {message: message},
});
};
const addSystemMessageLog_FromBackend = (payload) => {
addSystemMessageLog(payload.message);
};
const updateSentMessageLogById = (payload) => {
updateMessageLogs(updateItemById(payload.id, payload.translation));
@@ -66,6 +69,7 @@ export const useMessage = () => {
currentMessageLogs,
sendMessage,
addSystemMessageLog,
addSystemMessageLog_FromBackend,
updateSentMessageLogById,
addSentMessageLog,
addReceivedMessageLog,

View File

@@ -2,16 +2,26 @@ import { useStdoutToPython } from "@useStdoutToPython";
export const useOpenFolder = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const openFolder_MessageLogs = () => {
asyncStdoutToPython("/run/open_filepath_logs");
};
const openedFolder_MessageLogs = () => {
console.log("Opened Directory, Message Logs");
};
const openFolder_ConfigFile = () => {
asyncStdoutToPython("/run/open_filepath_config_file");
};
const openedFolder_ConfigFile = () => {
console.log("Opened Directory, Config File");
};
return {
openFolder_MessageLogs,
openFolder_ConfigFile,
openedFolder_MessageLogs,
openedFolder_ConfigFile,
};
};

View File

@@ -13,6 +13,13 @@ export const useSoftwareVersion = () => {
asyncStdoutToPython("/get/data/version");
};
const updateSoftwareVersionInfo = (payload) => {
updateLatestSoftwareVersionInfo(prev => ({
is_update_available: payload.is_update_available,
new_version: payload.new_version || prev.data.new_version,
}));
};
const isPluginCompatible = (main_version, lower_version, upper_version) => {
// lower_version 以上かつ upper_version 以下なら互換性ありと判定
return semver.gte(main_version, lower_version) && semver.lte(main_version, upper_version);
@@ -32,6 +39,7 @@ export const useSoftwareVersion = () => {
getSoftwareVersion,
updateSoftwareVersion,
updateSoftwareVersionInfo,
currentLatestSoftwareVersionInfo,
updateLatestSoftwareVersionInfo,