Skip to content

Commit

Permalink
Merge pull request #49 from alan-turing-institute/dev-markus
Browse files Browse the repository at this point in the history
Miscellaneous small bug fixes
  • Loading branch information
nbarlowATI committed Mar 9, 2022
2 parents 2858d51 + 2ae3116 commit 36029ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/ItemCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ function ItemCreator(props) {
console.log("in handleSubmit, parentId is ", parentId);
const res = createDBObject();
console.log("db object created?", res);
return new Promise((resolve) => {
props.updateView(resolve);
return res.then((resolve) => {
props.updateView();
});
//props.updateView();
}

async function createDBObject() {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ItemEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ function ItemEditor(props) {

function handleDelete(event) {
console.log("in handleDelete ", props.type, props.id, event);
deleteDBObject();
props.updateView();
deleteDBObject().then((resolve) => props.updateView());
}

async function deleteDBObject() {
Expand Down Expand Up @@ -144,6 +143,7 @@ function ItemEditor(props) {
{configData.navigation[props.type]["children"].map((childType) => (
<Button
pad="small"
key={childType}
onClick={(e) => props.createItemLayer(childType, props.id, e)}
label={"Create new " + childType}
/>
Expand Down

0 comments on commit 36029ab

Please sign in to comment.