Post publish message before delay in handlePublish
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -47,14 +47,14 @@ export default function App() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const handlePublish = async (data: any, route?: { key: string }) => {
|
const handlePublish = async (data: any, route?: { key: string }) => {
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
||||||
if (typeof window !== "undefined" && window.parent !== window) {
|
if (typeof window !== "undefined" && window.parent !== window) {
|
||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{ type: "PUBLISH", data: { data, route: route?.key } },
|
{ type: "PUBLISH", data: { data, route: route?.key } },
|
||||||
"*",
|
"*",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||||
|
};
|
||||||
|
|
||||||
const plugins = useMemo(
|
const plugins = useMemo(
|
||||||
() => [createTailwindCdnPlugin()],
|
() => [createTailwindCdnPlugin()],
|
||||||
|
|||||||
Reference in New Issue
Block a user