[bugfix] Fix settings data has not sync when init startup the software.(Mic Word Filter, VRC Mic Mute Sync)
This commit is contained in:
@@ -97,6 +97,21 @@ export const useTranscription = () => {
|
||||
asyncStdoutToPython("/set/data/mic_word_filter", selected_mic_word_filter);
|
||||
};
|
||||
|
||||
const getSuccessMicWordFilterList = (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;
|
||||
});
|
||||
};
|
||||
|
||||
const setSuccessMicWordFilterList = (payload) => {
|
||||
updateMicWordFilterList((prev_list) => {
|
||||
const updated_list = [...prev_list.data];
|
||||
@@ -283,6 +298,7 @@ export const useTranscription = () => {
|
||||
|
||||
currentMicWordFilterList,
|
||||
getMicWordFilterList,
|
||||
getSuccessMicWordFilterList,
|
||||
updateMicWordFilterList,
|
||||
setMicWordFilterList,
|
||||
setSuccessMicWordFilterList,
|
||||
|
||||
Reference in New Issue
Block a user