fix: use data prop instead of parent() for sensitive images SSR (#481)
* fix: use data prop instead of parent() for sensitive images SSR
The +layout.ts file was incorrectly using parent() to access data from
+layout.server.ts. In SvelteKit, data from a server load function in the
same route comes via the data parameter, not parent(). parent() is only
for accessing data from parent routes.
This fixes SSR meta tag generation for sensitive images.
* fix: handle nullable data parameter in layout load function
TypeScript was complaining that data could be null. Use optional
chaining and extract sensitiveImages to a variable to avoid repetition.
authored by
zzstoatzz.io
and committed by
GitHub
27f05692
46013bd8