Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(site): require a scalar header layout setting

Timothy Yinb4bb2c87df22
diff --git a/packages/contracts/src/gallery-settings.ts b/packages/contracts/src/gallery-settings.ts
index 6064694d..ddbb2514 100644
--- a/packages/contracts/src/gallery-settings.ts
+++ b/packages/contracts/src/gallery-settings.ts
@@ -53,7 +53,7 @@ export function parseGalleryPresentation(value: unknown): GalleryPresentation {
Object.keys(data).some(
(k) => !['homeHeaderLayout', 'socialLinks'].includes(k),
) ||
- !['embedded', 'fixed'].includes(String(data.homeHeaderLayout))
+ (data.homeHeaderLayout !== 'embedded' && data.homeHeaderLayout !== 'fixed')
)
throw new Error('Invalid home header layout')
return {
diff --git a/tests/platform-provisioning.test.ts b/tests/platform-provisioning.test.ts
index 2f89a2aa..8c379156 100644
--- a/tests/platform-provisioning.test.ts
+++ b/tests/platform-provisioning.test.ts
@@ -256,6 +256,7 @@ test('Real D1 provisioning preserves old tenants, serializes defaults and enforc
)
for (const presentation of [
{ homeHeaderLayout: 'invalid', socialLinks: { links: [] } },
+ { homeHeaderLayout: ['fixed'], socialLinks: { links: [] } },
{
homeHeaderLayout: 'fixed',
socialLinks: { links: ['javascript:alert(1)'] },