fix: update reset functionality in useConfig and ConfigVocespace components (#284)
This commit is contained in:
@@ -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 = () => {
|
||||
|
||||
@@ -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> */}
|
||||
|
||||
Reference in New Issue
Block a user