Fixed bugs.

This commit is contained in:
2022-09-15 09:13:30 -07:00
parent 6fe980ae6e
commit d7319e340c
5 changed files with 40 additions and 35 deletions

View File

@@ -65,9 +65,10 @@ const AssignmentsByAsset = () => {
return {foundAsset}
});
useEffect(() => {
if(assetIdInput) assetIdInput.focus()
})
//This works too well. The field always gets focus anytime anything is typed anywhere.
// useEffect(() => {
// if(assetIdInput) assetIdInput.focus()
// })
const unassign = () => {
// Open the dialog to get condition and comment.
@@ -81,7 +82,10 @@ const AssignmentsByAsset = () => {
if(unassign === true) {
// Call assets.unassign(assetId, comment, condition, conditionDetails, date)
Meteor.call('assets.unassign', foundAsset.assetId, unassignComment, unassignCondition, unassignConditionDetails)
Meteor.call('assets.unassign', foundAsset.assetId, unassignComment, unassignCondition, unassignConditionDetails, (err, result) => {
if(err) console.error(err)
else if(assetIdInput) assetIdInput.focus()
})
}
}