Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mgineer85 committed Jan 4, 2025
1 parent 3e7aa11 commit 8b68f57
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<!-- auto-start slideshow after timeout -->
<RouteAfterTimeout
v-if="configurationStore.getConfigElement('uisettings.show_automatic_slideshow_timeout', 0) > 0"
v-if="configurationStore.getConfigElement('uisettings.show_automatic_slideshow_timeout', 0) > 0 && mediacollectionStore.collection.length > 0"
route="/slideshow/random"
:timeout-ms="configurationStore.getConfigElement('uisettings.show_automatic_slideshow_timeout', 60) * 1000"
:warning-message="$t('MSG_WARN_BEFORE_AUTO_SLIDESHOW')"
Expand All @@ -18,6 +18,7 @@
import { defineComponent } from 'vue';
import { useStateStore } from '../stores/state-store.js';
import { useConfigurationStore } from '../stores/configuration-store.ts';
import { useMediacollectionStore } from '../stores/mediacollection-store.js';
import { useRouter } from 'vue-router';
import RouteAfterTimeout from 'src/components/RouteAfterTimeout.vue';
Expand All @@ -28,6 +29,7 @@ export default defineComponent({
setup() {
const stateStore = useStateStore();
const configurationStore = useConfigurationStore();
const mediacollectionStore = useMediacollectionStore();
const router = useRouter();
// watch state to force router to "/" if a capture is triggered
Expand All @@ -49,6 +51,7 @@ export default defineComponent({
return {
// you can return the whole store instance to use it in the template
configurationStore,
mediacollectionStore,
};
},
computed: {},
Expand Down
13 changes: 13 additions & 0 deletions src/pages/SlideshowPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<q-page id="slideshow-page" class="full-height">
<gallery-image-detail
v-if="mediacollectionStore.collection.length > 0"
:show-toolbar="false"
:slideshow-timeout="5000"
:slideshow-use-fade="true"
Expand All @@ -9,6 +10,18 @@
:random-order="true"
class="full-height"
></gallery-image-detail>
<div v-else>
<div class="fullscreen bg-blue text-white text-center q-pa-md flex flex-center">
<div>
<!-- eslint-disable-next-line -->
<div class="text-h2" style="opacity: 0.4">
{{ $t('MSG_ERROR_NOT_FOUND') }}
</div>

<q-btn class="q-mt-xl" color="white" text-color="blue" unelevated to="/" label="Go Home" no-caps />
</div>
</div>
</div>
</q-page>
</template>

Expand Down

0 comments on commit 8b68f57

Please sign in to comment.