Files
VRCT/src-ui/logics/configs/translation/useSelectableCTranslate2ComputeDeviceList.js
Sakamoto Shiina fb2b224231 [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.
2025-06-14 03:29:22 +09:00

25 lines
1.1 KiB
JavaScript

import { useStore_SelectableCTranslate2ComputeDeviceList } from "@store";
import { useStdoutToPython } from "@useStdoutToPython";
import { transformToIndexedArray } from "@utils";
export const useSelectableCTranslate2ComputeDeviceList = () => {
const { asyncStdoutToPython } = useStdoutToPython();
const { currentSelectableCTranslate2ComputeDeviceList, updateSelectableCTranslate2ComputeDeviceList, pendingSelectableCTranslate2ComputeDeviceList } = useStore_SelectableCTranslate2ComputeDeviceList();
const getSelectableCTranslate2ComputeDeviceList = () => {
pendingSelectableCTranslate2ComputeDeviceList();
asyncStdoutToPython("/get/data/translation_compute_device_list");
};
const updateSelectableCTranslate2ComputeDeviceList_FromBackend = (payload) => {
updateSelectableCTranslate2ComputeDeviceList(transformToIndexedArray(payload));
};
return {
currentSelectableCTranslate2ComputeDeviceList,
getSelectableCTranslate2ComputeDeviceList,
updateSelectableCTranslate2ComputeDeviceList,
updateSelectableCTranslate2ComputeDeviceList_FromBackend,
};
};