Skip to content

Commit

Permalink
fix: react to slot changes properly
Browse files Browse the repository at this point in the history
Signed-off-by: Mathis Mensing <[email protected]>
  • Loading branch information
matmen committed Jun 3, 2024
1 parent 6d3ed14 commit 02cb0c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/components/common/CollapsableCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,11 @@ export default class CollapsableCard extends Vue {
}
get hasCollapsedContentSlot () {
return !!this.$slots['collapsed-content'] || !!this.$scopedSlots['collapsed-content']
// no idea if the slot has children, so we assume it does
if (this.$scopedSlots['collapse-button']) return true
// return true if slot is defined and has child elements
return !!this.$slots['collapsed-content']?.length
}
mounted () {
Expand Down
6 changes: 2 additions & 4 deletions src/components/widgets/status/PrinterStatusCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
/>
</template>

<template
v-if="printerPrinting || printerPaused || filename"
#collapsed-content
>
<template #collapsed-content>
<v-progress-linear
v-if="printerPrinting || printerPaused || filename"
:height="6"
:value="estimates.progress"
color="primary"
Expand Down

0 comments on commit 02cb0c1

Please sign in to comment.