mirror of https://github.com/astral-sh/ruff
fix; correcting the order of function calls
This commit is contained in:
parent
0138cd238a
commit
72544413e2
|
|
@ -1,7 +1,7 @@
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import AstralButton from "./AstralButton";
|
import AstralButton from "./AstralButton";
|
||||||
|
|
||||||
export default function ShareButton({ onShare }: { onShare: () => void }) {
|
export default function ShareButton({ onShare }: { onShare: () => Promise<void> }) {
|
||||||
const [copied, setCopied] = useState(false);
|
const [copied, setCopied] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -29,9 +29,9 @@ export default function ShareButton({ onShare }: { onShare: () => void }) {
|
||||||
type="button"
|
type="button"
|
||||||
className="relative flex-none leading-6 py-1.5 px-3 shadow-xs disabled:opacity-50"
|
className="relative flex-none leading-6 py-1.5 px-3 shadow-xs disabled:opacity-50"
|
||||||
disabled={copied}
|
disabled={copied}
|
||||||
onClick={() => {
|
onClick={async () => {
|
||||||
|
await onShare();
|
||||||
setCopied(true);
|
setCopied(true);
|
||||||
onShare();
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue