chore: checkpoint admin editor and perf work
This commit is contained in:
@@ -5,21 +5,25 @@ import Footer from '../components/Footer.astro';
|
||||
import BackToTop from '../components/interactive/BackToTop.svelte';
|
||||
import { api, DEFAULT_SITE_SETTINGS } from '../lib/api/client';
|
||||
import { getI18n, LOCALE_COOKIE_NAME, SUPPORTED_LOCALES } from '../lib/i18n';
|
||||
import type { SiteSettings } from '../lib/types';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
description?: string;
|
||||
siteSettings?: SiteSettings;
|
||||
}
|
||||
|
||||
const props = Astro.props;
|
||||
const { locale, messages } = getI18n(Astro);
|
||||
|
||||
let siteSettings = DEFAULT_SITE_SETTINGS;
|
||||
let siteSettings = props.siteSettings ?? DEFAULT_SITE_SETTINGS;
|
||||
|
||||
try {
|
||||
siteSettings = await api.getSiteSettings();
|
||||
} catch (error) {
|
||||
console.error('Failed to load site settings:', error);
|
||||
if (!props.siteSettings) {
|
||||
try {
|
||||
siteSettings = await api.getSiteSettings();
|
||||
} catch (error) {
|
||||
console.error('Failed to load site settings:', error);
|
||||
}
|
||||
}
|
||||
|
||||
const title = props.title || siteSettings.siteTitle;
|
||||
@@ -305,7 +309,7 @@ const i18nPayload = JSON.stringify({ locale, messages });
|
||||
</main>
|
||||
|
||||
<Footer siteSettings={siteSettings} />
|
||||
<BackToTop client:load />
|
||||
<BackToTop client:idle />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user