[Update] Config Page: Add Translation Tab. DeeplAuthKey section.
Allow null value to Entry component's input element.
This commit is contained in:
30
src-ui/logics/configs/translation/useDeepLAuthKey.js
Normal file
30
src-ui/logics/configs/translation/useDeepLAuthKey.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import { useStore_DeepLAuthKey } from "@store";
|
||||
import { useStdoutToPython } from "@logics/useStdoutToPython";
|
||||
|
||||
export const useDeepLAuthKey = () => {
|
||||
const { asyncStdoutToPython } = useStdoutToPython();
|
||||
const { currentDeepLAuthKey, updateDeepLAuthKey, pendingDeepLAuthKey } = useStore_DeepLAuthKey();
|
||||
|
||||
const getDeepLAuthKey = () => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/get/data/deepl_auth_key");
|
||||
};
|
||||
|
||||
const setDeepLAuthKey = (selected_deepl_auth_key) => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/set/data/deepl_auth_key", selected_deepl_auth_key);
|
||||
};
|
||||
|
||||
const deleteDeepLAuthKey = () => {
|
||||
pendingDeepLAuthKey();
|
||||
asyncStdoutToPython("/delete/data/deepl_auth_key");
|
||||
};
|
||||
|
||||
return {
|
||||
currentDeepLAuthKey,
|
||||
getDeepLAuthKey,
|
||||
updateDeepLAuthKey,
|
||||
setDeepLAuthKey,
|
||||
deleteDeepLAuthKey,
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user