diff --git a/web/SitePreview.tsx b/web/SitePreview.tsx index 0db8cbd..8acea7d 100644 --- a/web/SitePreview.tsx +++ b/web/SitePreview.tsx @@ -45,6 +45,7 @@ export const SitePreview = ({ path, theme, onDocument, + reloadToken, }: { port: number | null; /** The site path to show — `layout`, `about`, or `` for the front page. No leading slash. */ @@ -67,6 +68,17 @@ export const SitePreview = ({ * document it was injected into. */ onDocument?: (document: Document) => void | (() => void); + /** + * Change this to fetch the page again. + * + * The site renders from the database, so anything written there only appears when the document is + * requested anew. The admin cannot draw the change itself — it does not know how to render a page, + * and if it did it would be a second implementation of the one thing this preview exists to avoid. + * + * Remounts the frame rather than calling `contentWindow.location.reload()`. Both work while the frame + * is same-origin, and the remount is one mechanism that would still work if it ever were not. + */ + reloadToken?: number; }) => { const client = useClient(); /* @@ -221,6 +233,9 @@ export const SitePreview = ({ remove the attribute. This is the owner's own development server on this machine. */