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
@@ -1,6 +1,6 @@
{ {
"name": "vocechat-web", "name": "vocechat-web",
"version": "0.9.38", "version": "0.9.39",
"homepage": "https://voce.chat", "homepage": "https://voce.chat",
"dependencies": { "dependencies": {
"@metamask/onboarding": "^1.0.1", "@metamask/onboarding": "^1.0.1",
+1 -1
View File
@@ -101,7 +101,7 @@ export default function useConfig(config: keyof ConfigMap = "smtp") {
const updated = updates[config]; const updated = updates[config];
const updating = updatings[config]; const updating = updatings[config];
const reset = () => { const reset = () => {
setValues(undefined); setValues(originalValue ? { ...originalValue } : undefined);
}; };
const toggleEnable = () => { const toggleEnable = () => {
+1 -10
View File
@@ -231,16 +231,7 @@ export function ConfigVocespace() {
{changed && ( {changed && (
<SaveTip <SaveTip
saveHandler={handleUpdate} saveHandler={handleUpdate}
resetHandler={() => { resetHandler={reset}
// empty all input
setValues({
url: "",
license: "",
enabled: true,
password: "",
state,
});
}}
/> />
)} )}
{/* <button onClick={handleUpdate} className="btn">update</button> */} {/* <button onClick={handleUpdate} className="btn">update</button> */}