Skip to content

Commit e22bc90

Browse files
committed
Only show spinner in content container if there is content inside
Closes #504
1 parent 4a183f9 commit e22bc90

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Tekst-Web/src/components/browse/ContentContainer.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const contentContainerTitle = computed(() =>
5353
const headerWidgetsOpacity = computed<number>(() =>
5454
isContentContainerHovered.value || state.isTouchDevice ? 1 : browse.reducedView ? 0 : 0.2
5555
);
56-
const hasContent = computed(() => props.resource.contents?.length);
56+
const hasContent = computed(() => !!props.resource.contents?.length);
5757
const show = computed(() => props.resource.active && (hasContent.value || !browse.reducedView));
5858
const fromChildLevel = computed(
5959
() => props.resource.level - 1 === browse.level && props.resource.config.common.showOnParentLevel
@@ -87,6 +87,7 @@ const fromChildLevel = computed(
8787
</div>
8888
<div class="content-header-title-extra">
8989
{{ headerExtraText }}
90+
<span v-if="loading && !hasContent" class="ml-lg">{{ $t('general.loading') }}</span>
9091
</div>
9192
</div>
9293
<content-header-widget-bar
@@ -96,7 +97,7 @@ const fromChildLevel = computed(
9697
/>
9798
</div>
9899

99-
<n-spin :show="loading" size="small">
100+
<n-spin :show="loading && hasContent" size="small">
100101
<div
101102
v-if="hasContent"
102103
class="content"

0 commit comments

Comments
 (0)