Skip to content

Commit

Permalink
fix: properly show error message
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkvasnicak committed Nov 6, 2024
1 parent ca9f594 commit 1bd29cb
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ export default function MiniappPage({
const [message, setMessage] = useState<any>(null);

const handleMessage = useCallback((m: MessageEvent) => {
console.log(
"received",
m,
m.source === windowObject,
m.source === windowObject?.parent,
window === windowObject,
window === windowObject?.parent,
windowObject === windowObject?.parent,
windowObject,
windowObject?.parent
);
console.log("received", m);

if (m.source === windowObject?.parent) {
setMessage(m.data);
Expand Down Expand Up @@ -167,7 +157,7 @@ export default function MiniappPage({
{message?.result ? (
<pre>{JSON.stringify(message?.result, null, 2)}</pre>
) : (
<div className="text-red-500">{message?.result?.message}</div>
<div className="text-red-500">{message?.error?.message}</div>
)}
</div>
);
Expand Down

0 comments on commit 1bd29cb

Please sign in to comment.