Skip to content

Commit

Permalink
🐛 Fixes unable to add new app bug (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lissy93 committed Jan 9, 2022
1 parent 2ec5966 commit d10e6a8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/components/LinkItems/Section.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
@openContextMenu="openContextMenu"
>
<!-- If no items, show message -->
<div v-if="sectionType === 'empty'" class="no-items">
<div v-if="isEmpty" class="no-items">
{{ $t('home.no-items-section') }}
</div>
<!-- Item Container -->
<div v-else-if="sectionType === 'item'"
<div v-if="hasItems"
:class="`there-are-items ${isGridLayout? 'item-group-grid': ''} inner-size-${itemSize}`"
:style="gridStyle" :id="`section-${groupId}`"
> <!-- Show for each item -->
Expand Down Expand Up @@ -58,7 +58,7 @@
/>
</div>
<div
v-else-if="sectionType === 'widget'"
v-if="hasWidgets"
:class="`widget-list ${isWide? 'wide' : ''}`">
<WidgetBase
v-for="(widget, widgetIndx) in widgets"
Expand Down Expand Up @@ -154,11 +154,15 @@ export default {
sortOrder() {
return this.displayData.sortBy || defaultSortOrder;
},
/* A section can contain either items or widgets */
sectionType() {
if (this.widgets && this.widgets.length > 0) return 'widget';
if (this.items && this.items.length > 0) return 'item';
return 'empty';
hasItems() {
if (this.isEditMode) return true;
return this.items && this.items.length > 0;
},
hasWidgets() {
return this.widgets && this.widgets.length > 0;
},
isEmpty() {
return !this.hasItems && !this.hasWidgets;
},
/* If the sortBy attribute is specified, then return sorted data */
sortedItems() {
Expand Down

0 comments on commit d10e6a8

Please sign in to comment.