bigbuffet-rw/app/soapbox/precheck.ts
marcin mikołajczak 3448022965 Support translation feature on Mastodon
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-10-27 19:48:41 +02:00

13 lines
548 B
TypeScript

/**
* Precheck: information about the site before anything renders.
* @module soapbox/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). */
export const isPrerendered = hasPrerenderPleroma || hasPrerenderMastodon;