fixed cookie edit saving logic

This commit is contained in:
Adam Haglund committed 2017-08-20 00:56:14 +02:00
1 parent 69b771e245
commit fc6ea3f34d
1 file changed
+4 -5
@@ -94,9 +94,12 @@ class CookieModifyModal extends PureComponent {
}
if (valid) {
const newCookie = Object.assign({}, cookie, {[field]: input});
clearTimeout(this._cookieUpdateTimeout);
this._cookieUpdateTimeout = setTimeout(() => {
this._handleCookieUpdate(cookie, Object.assign({}, cookie, {[field]: input}));
this._handleCookieUpdate(cookie, newCookie);
this.setState({cookie: newCookie});
}, DEBOUNCE_MILLIS * 2);
}
@@ -104,10 +107,6 @@ class CookieModifyModal extends PureComponent {
isValid: {
...this.state.isValid,
[field]: valid
},
cookie: {
...cookie,
[field]: input
}
});
}