bigbuffet-rw/packages/pl-fe/src/precheck.ts
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

15 lines
565 B
TypeScript

/**
* Precheck: information about the site before anything renders.
* @module pl-fe/precheck
*/
/** Whether pre-rendered data exists in Pleroma's format. */
const hasPrerenderPleroma = Boolean(document.getElementById('initial-results'));
/** Whether pre-rendered data exists in Mastodon's format. */
const hasPrerenderMastodon = Boolean(document.getElementById('initial-state'));
/** Whether initial data was loaded into the page by server-side-rendering (SSR). */
const isPrerendered = hasPrerenderPleroma || hasPrerenderMastodon;
export { isPrerendered };