From 72544413e278c606be899ae6a76feb0b71963877 Mon Sep 17 00:00:00 2001 From: mahiro72 Date: Fri, 12 Dec 2025 19:59:26 +0900 Subject: [PATCH] fix; correcting the order of function calls --- playground/shared/src/ShareButton.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/playground/shared/src/ShareButton.tsx b/playground/shared/src/ShareButton.tsx index 65fdca5da7..05a461bd48 100644 --- a/playground/shared/src/ShareButton.tsx +++ b/playground/shared/src/ShareButton.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import AstralButton from "./AstralButton"; -export default function ShareButton({ onShare }: { onShare: () => void }) { +export default function ShareButton({ onShare }: { onShare: () => Promise }) { const [copied, setCopied] = useState(false); useEffect(() => { @@ -29,9 +29,9 @@ export default function ShareButton({ onShare }: { onShare: () => void }) { type="button" className="relative flex-none leading-6 py-1.5 px-3 shadow-xs disabled:opacity-50" disabled={copied} - onClick={() => { + onClick={async () => { + await onShare(); setCopied(true); - onShare(); }} >