Skip to content

Commit

Permalink
ftr/PartsInGoToMenu: fix wrong handling if there are no parts in source
Browse files Browse the repository at this point in the history
due changes in last commit (10ba464) the array also exist if there are no parts, therefore its necessary to check for its lenght and not existence
  • Loading branch information
Tobias Bachmann committed Dec 10, 2024
1 parent 10ba464 commit 3e4992f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/view/window/source/SourceView.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ Ext.define('EdiromOnline.view.window.source.SourceView', {

// iterate over submitted movements and push them to movementItems variable
movements.data.each(function(movement) {
if(movement.data.parts === null) {
if(movement.data.parts.length === 0) {
movementItems.push({
text: movement.get('name'),
handler: Ext.bind(me.gotoMovement, me, movement.get('id'), true)
Expand Down Expand Up @@ -308,7 +308,6 @@ Ext.define('EdiromOnline.view.window.source.SourceView', {
});
}


// check if contains more than one item and save to variable as boolean
var isDisabled = ((movementItems.length < 1) ? true : false);

Expand Down

0 comments on commit 3e4992f

Please sign in to comment.