Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression on splash screen not shown #976

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions src/components/dialog/StartupDialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<TermsOfUseDialog v-if="shouldAgreeToTerms" v-model="showTermsDialog" />
<TermsOfUseDialog
v-if="shouldAgreeToTerms && showTermsDialog"
v-model="showTermsDialog"
/>
<SplashScreenDialog
v-if="splashSrc && !showTermsDialog"
v-else-if="splashSrc"
v-model="showSplashDialog"
:img-url="splashSrc"
:version="packageConfig.version"
Expand All @@ -20,13 +23,14 @@ import { asyncComputed, useStorage } from '@vueuse/core'
const configStore = useConfigStore()

const imagesBaseUrl = `${import.meta.env.BASE_URL}images/`
const splashSrc = asyncComputed(
async () =>
await getLocalOrRemoteFileUrl(
imagesBaseUrl,
configStore.general.splashScreen,
),
)

const splashSrc = asyncComputed(async () => {
if (!configStore.general.splashScreen) return
return await getLocalOrRemoteFileUrl(
imagesBaseUrl,
configStore.general.splashScreen,
)
})

const shouldAgreeToTerms = computed(
() => configStore.general.agreeToTermsAndConditions?.enabled ?? false,
Expand Down
4 changes: 4 additions & 0 deletions src/layouts/DefaultLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ watch(
async () => {
const imagesBaseUrl = `${import.meta.env.BASE_URL}images/`
const defaultLogo = `${imagesBaseUrl}logo.png`
if (configStore.general.icons?.logo === undefined) {
logoSrc.value = defaultLogo
return
}
const logoUrl = await getLocalOrRemoteFileUrl(
imagesBaseUrl,
configStore.general.icons?.logo,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/fews-config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ export function getResourcesIconsUrl(resource: string) {

export async function getLocalOrRemoteFileUrl(
localBase: string,
relativePath?: string,
relativePath: string,
) {
if (!relativePath) return
const remoteUrl = getResourcesStaticUrl(relativePath)
const localUrl = `${localBase}${relativePath}`

Expand Down
Loading