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