Skip to content

Commit

Permalink
cleanup: remove unused property from computed watchlist
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasnys committed Jul 23, 2024
1 parent a896e0c commit 85abb7f
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions addon/-private/collapse-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,31 +83,27 @@ export const TableRowMeta = EmberObject.extend({
}
),

isGroupIndeterminate: computed(
'_tree.{selection.[],selectionMatchFunction}',
'_parentMeta.isSelected',
function() {
let rowValue = get(this, '_rowValue');
let selection = get(this, '_tree.selection');
let selectionMatchFunction = get(this, '_tree.selectionMatchFunction');

if (!rowValue.children || !isArray(rowValue.children)) {
return false;
}
isGroupIndeterminate: computed('_tree.{selection.[],selectionMatchFunction}', function() {
let rowValue = get(this, '_rowValue');
let selection = get(this, '_tree.selection');
let selectionMatchFunction = get(this, '_tree.selectionMatchFunction');

if (!selection || !isArray(selection)) {
return false;
}
if (!rowValue.children || !isArray(rowValue.children)) {
return false;
}

if (selectionMatchFunction) {
return rowValue.children.some(child =>
selection.some(item => selectionMatchFunction(item, child))
);
}
if (!selection || !isArray(selection)) {
return false;
}

return rowValue.children.some(child => selection.includes(child));
if (selectionMatchFunction) {
return rowValue.children.some(child =>
selection.some(item => selectionMatchFunction(item, child))
);
}
),

return rowValue.children.some(child => selection.includes(child));
}),

canCollapse: computed(
'_tree.{enableTree,enableCollapse}',
Expand Down

0 comments on commit 85abb7f

Please sign in to comment.