Post publish message before delay in handlePublish

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Rami Bitar
2026-05-11 23:13:02 -04:00
parent 60e262465e
commit 0b135b8a32

View File

@@ -47,14 +47,14 @@ export default function App() {
);
const handlePublish = async (data: any, route?: { key: string }) => {
await new Promise((resolve) => setTimeout(resolve, 1000));
if (typeof window !== "undefined" && window.parent !== window) {
window.parent.postMessage(
{ type: "PUBLISH", data: { data, route: route?.key } },
"*",
);
}
}
await new Promise((resolve) => setTimeout(resolve, 1000));
};
const plugins = useMemo(
() => [createTailwindCdnPlugin()],