From d1fa9065263afa15ea5b20e5e9550651029801fd Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Sun, 9 Feb 2020 14:44:03 -0800 Subject: [PATCH] Clear input fields on New Identity Signed-off-by: James Ketrenos --- src/App.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/App.js b/src/App.js index 8a70499..913a90e 100755 --- a/src/App.js +++ b/src/App.js @@ -61,6 +61,7 @@ class Identities extends React.Component { constructor(props) { super(props); } + componentDidMount() { let params = window.location.search ? window.location.search.replace(/^\?/, "").split("&") : [], id; @@ -426,6 +427,12 @@ function createNewIdenityEditor() { body: JSON.stringify(object) }).then(res => res.json()).then((identities) => { console.log("New identity: ", identities[0]); + let inputs = editor.querySelectorAll("input"); + Array.prototype.forEach.call(inputs, (el) => { + if (el.value) { + el.value = ""; + } + }); const face = document.body.querySelector("#face-editor .face"); loadFace(parseInt(face.getAttribute("face-id"))); });