Skip to content

Commit

Permalink
Only show spinner in content container if there is content inside
Browse files Browse the repository at this point in the history
Closes #504
  • Loading branch information
bkis committed Nov 14, 2024
1 parent 4a183f9 commit e22bc90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Tekst-Web/src/components/browse/ContentContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const contentContainerTitle = computed(() =>
const headerWidgetsOpacity = computed<number>(() =>
isContentContainerHovered.value || state.isTouchDevice ? 1 : browse.reducedView ? 0 : 0.2
);
const hasContent = computed(() => props.resource.contents?.length);
const hasContent = computed(() => !!props.resource.contents?.length);
const show = computed(() => props.resource.active && (hasContent.value || !browse.reducedView));
const fromChildLevel = computed(
() => props.resource.level - 1 === browse.level && props.resource.config.common.showOnParentLevel
Expand Down Expand Up @@ -87,6 +87,7 @@ const fromChildLevel = computed(
</div>
<div class="content-header-title-extra">
{{ headerExtraText }}
<span v-if="loading && !hasContent" class="ml-lg">{{ $t('general.loading') }}</span>
</div>
</div>
<content-header-widget-bar
Expand All @@ -96,7 +97,7 @@ const fromChildLevel = computed(
/>
</div>

<n-spin :show="loading" size="small">
<n-spin :show="loading && hasContent" size="small">
<div
v-if="hasContent"
class="content"
Expand Down

0 comments on commit e22bc90

Please sign in to comment.