diff --git a/playground/ruff/src/Editor/Chrome.tsx b/playground/ruff/src/Editor/Chrome.tsx index 3fc9ddca2a..a86f4e589f 100644 --- a/playground/ruff/src/Editor/Chrome.tsx +++ b/playground/ruff/src/Editor/Chrome.tsx @@ -16,12 +16,12 @@ export default function Chrome() { const [theme, setTheme] = useTheme(); - const handleShare = useCallback(() => { + const handleShare = useCallback(async () => { if (settings == null || pythonSource == null) { return; } - persist(settings, pythonSource).catch((error) => + await persist(settings, pythonSource).catch((error) => // eslint-disable-next-line no-console console.error(`Failed to share playground: ${error}`), ); diff --git a/playground/shared/src/Header.tsx b/playground/shared/src/Header.tsx index 7881fb5344..5b80f256b3 100644 --- a/playground/shared/src/Header.tsx +++ b/playground/shared/src/Header.tsx @@ -21,7 +21,7 @@ export default function Header({ version: string | null; onChangeTheme: (theme: Theme) => void; onReset?(): void; - onShare: () => void; + onShare: () => Promise; }) { return (
{ + const handleShare = useCallback(async () => { const serialized = serializeFiles(files); if (serialized != null) { - persist(serialized).catch((error) => { + await persist(serialized).catch((error) => { // eslint-disable-next-line no-console console.error("Failed to share playground", error); });