mirror of https://github.com/astral-sh/ruff
fix; function signatures
This commit is contained in:
parent
72544413e2
commit
b23ce09da3
|
|
@ -16,12 +16,12 @@ export default function Chrome() {
|
||||||
|
|
||||||
const [theme, setTheme] = useTheme();
|
const [theme, setTheme] = useTheme();
|
||||||
|
|
||||||
const handleShare = useCallback(() => {
|
const handleShare = useCallback(async () => {
|
||||||
if (settings == null || pythonSource == null) {
|
if (settings == null || pythonSource == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
persist(settings, pythonSource).catch((error) =>
|
await persist(settings, pythonSource).catch((error) =>
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(`Failed to share playground: ${error}`),
|
console.error(`Failed to share playground: ${error}`),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export default function Header({
|
||||||
version: string | null;
|
version: string | null;
|
||||||
onChangeTheme: (theme: Theme) => void;
|
onChangeTheme: (theme: Theme) => void;
|
||||||
onReset?(): void;
|
onReset?(): void;
|
||||||
onShare: () => void;
|
onShare: () => Promise<void>;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,11 @@ export default function Playground() {
|
||||||
|
|
||||||
usePersistLocally(files);
|
usePersistLocally(files);
|
||||||
|
|
||||||
const handleShare = useCallback(() => {
|
const handleShare = useCallback(async () => {
|
||||||
const serialized = serializeFiles(files);
|
const serialized = serializeFiles(files);
|
||||||
|
|
||||||
if (serialized != null) {
|
if (serialized != null) {
|
||||||
persist(serialized).catch((error) => {
|
await persist(serialized).catch((error) => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error("Failed to share playground", error);
|
console.error("Failed to share playground", error);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue