[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:
@@ -15,10 +15,27 @@ export const useMicWordFilterList = () => {
|
||||
asyncStdoutToPython("/set/data/mic_word_filter", selected_mic_word_filter);
|
||||
};
|
||||
|
||||
const updateMicWordFilterList_FromBackend = (payload) => {
|
||||
updateMicWordFilterList((prev_list) => {
|
||||
const updated_list = [...prev_list.data];
|
||||
for (const value of payload) {
|
||||
const existing_item = updated_list.find(item => item.value === value);
|
||||
if (existing_item) {
|
||||
existing_item.is_redoable = false;
|
||||
} else {
|
||||
updated_list.push({ value, is_redoable: false });
|
||||
}
|
||||
}
|
||||
return updated_list;
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
currentMicWordFilterList,
|
||||
getMicWordFilterList,
|
||||
updateMicWordFilterList,
|
||||
setMicWordFilterList,
|
||||
|
||||
updateMicWordFilterList_FromBackend,
|
||||
};
|
||||
};
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useStore_SelectableWhisperComputeDeviceList } from "@store";
|
||||
import { useStdoutToPython } from "@useStdoutToPython";
|
||||
import { transformToIndexedArray } from "@utils";
|
||||
|
||||
export const useSelectableWhisperComputeDeviceList = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
@@ -10,9 +11,15 @@ export const useSelectableWhisperComputeDeviceList = () => {
|
||||
asyncStdoutToPython("/get/data/transcription_compute_device_list");
|
||||
};
|
||||
|
||||
const updateSelectableWhisperComputeDeviceList_FromBackend = (payload) => {
|
||||
updateSelectableWhisperComputeDeviceList(transformToIndexedArray(payload));
|
||||
};
|
||||
|
||||
return {
|
||||
currentSelectableWhisperComputeDeviceList,
|
||||
getSelectableWhisperComputeDeviceList,
|
||||
updateSelectableWhisperComputeDeviceList,
|
||||
|
||||
updateSelectableWhisperComputeDeviceList_FromBackend,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user