fix: update reset functionality in useConfig and ConfigVocespace components (#284)

This commit is contained in:
haorwen
2025-12-26 12:58:46 +08:00
committed by GitHub
parent 37199506e3
commit 105d1865c8
3 changed files with 3 additions and 12 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ export default function useConfig(config: keyof ConfigMap = "smtp") {
const updated = updates[config];
const updating = updatings[config];
const reset = () => {
setValues(undefined);
setValues(originalValue ? { ...originalValue } : undefined);
};
const toggleEnable = () => {
+1 -10
View File
@@ -231,16 +231,7 @@ export function ConfigVocespace() {
{changed && (
<SaveTip
saveHandler={handleUpdate}
resetHandler={() => {
// empty all input
setValues({
url: "",
license: "",
enabled: true,
password: "",
state,
});
}}
resetHandler={reset}
/>
)}
{/* <button onClick={handleUpdate} className="btn">update</button> */}