[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

@@ -23,6 +23,9 @@ export const useDeepLAuthKey = () => {
pendingDeepLAuthKey();
asyncStdoutToPython("/delete/data/deepl_auth_key");
};
const deletedDeepLAuthKey = () => {
updateDeepLAuthKey("");
};
const savedDeepLAuthKey = (data) => {
updateDeepLAuthKey(data);
@@ -36,6 +39,7 @@ export const useDeepLAuthKey = () => {
setDeepLAuthKey,
deleteDeepLAuthKey,
deletedDeepLAuthKey,
savedDeepLAuthKey,
};
};

View File

@@ -1,5 +1,6 @@
import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store";
import { useStdoutToPython } from "@useStdoutToPython";
import { transformToIndexedArray } from "@utils";
export const useSelectableCTranslate2ComputeDeviceList = () => {
const { asyncStdoutToPython } = useStdoutToPython();
@@ -10,9 +11,15 @@ export const useSelectableCTranslate2ComputeDeviceList = () => {
asyncStdoutToPython("/get/data/translation_compute_device_list");
};
const updateSelectableCTranslate2ComputeDeviceList_FromBackend = (payload) => {
updateSelectableCTranslate2ComputeDeviceList(transformToIndexedArray(payload));
};
return {
currentSelectableCTranslate2ComputeDeviceList,
getSelectableCTranslate2ComputeDeviceList,
updateSelectableCTranslate2ComputeDeviceList,
updateSelectableCTranslate2ComputeDeviceList_FromBackend,
};
};