From 0b135b8a32ca51197cc32ea517802b08315c7436 Mon Sep 17 00:00:00 2001 From: Rami Bitar Date: Mon, 11 May 2026 23:13:02 -0400 Subject: [PATCH] Post publish message before delay in handlePublish Co-Authored-By: Claude Opus 4.7 --- src/App.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index ccf2166..a40d80d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -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 } }, - "*", - ); - } + 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()],