Skip to content

Commit

Permalink
simplify if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
adomi committed Feb 1, 2021
1 parent 811b167 commit 46679d1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
}
if (nodePaging?.list) {
const nodeEntries: NodeEntry[] = nodePaging.list.entries;
if (nodeEntries?.length > 0) {
if (nodeEntries?.length) {
shareDataRows = nodeEntries.map((item) => new ShareDataRow(item, this.contentService, this.permissionsStyle,
this.thumbnailService, this.allowDropFiles));

Expand All @@ -267,7 +267,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {

if (this.sortingMode !== 'server') {
// Sort by first sortable or just first column
if (this.columns?.length > 0) {
if (this.columns?.length) {
const sorting = this.getSorting();
if (sorting) {
this.sortRows(shareDataRows, sorting);
Expand Down Expand Up @@ -302,7 +302,7 @@ export class ShareDataTableAdapter implements DataTableAdapter {
}

selectRowsBasedOnGivenNodes(preselectNodes: NodeEntry[]) {
if (preselectNodes?.length > 0) {
if (preselectNodes?.length) {
this.rows = this.rows.map((row) => {
preselectNodes.map((preselectedNode) => {
if (row.obj.entry.id === preselectedNode.entry.id) {
Expand Down

0 comments on commit 46679d1

Please sign in to comment.