Skip to content

Commit

Permalink
fixed some text`
Browse files Browse the repository at this point in the history
`
  • Loading branch information
z-priest committed Jun 16, 2021
1 parent 90520fb commit bfd511d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@
<div id='metawidget' class="jsedit"></div>
<div id="commit-button" class="button-commit">
<button type="button" title="Commit" class="ui-button ui-widget ui-state-default ui-corner-all btn-commit" disabled=true>
<i class="fa fa-download"></i> Commit to DB</button>
<i class="fa fa-download"></i> Commit Object to DB</button>
<button type="button" title="Export" class="ui-button ui-widget ui-state-default ui-corner-all" id="btn-export-single">
<i class="fa fa-download"></i> Save as JSON...</button>
<i class="fa fa-download"></i> Save Object as JSON...</button>
</div>
</div>
</div>
Expand Down
10 changes: 7 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,18 +553,22 @@ export class main {
e.preventDefault();
e.stopPropagation();
let result: StixObject[];
let ourres = '';
try {
const formdata: StixObject = editor.editor.getValue();
db.updateDB(formdata).then((r) => { result = r; });
db.updateDB(formdata).then((r) => {
result = r;
// ourres = result[0]['type'];
});
} catch (e) {
console.error('Error saving to database:');
console.error(e);
throw e;
}
$('button.btn-commit').button('option', 'disabled', true);
$('.message-status').html(`Committed: ${JSON.stringify(result)}`);
$('.message-status').html(`Committed 1 object to the database.`);
});

/***********************************************************************************
*
* Widget Bar Code
Expand Down

1 comment on commit bfd511d

@z-priest
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message-status assumes commit, but this isn't verified.

Unable to access result set from db call, suspect it is some async/await issue. #53

Please sign in to comment.