[dep] update to eslint 9

This commit is contained in:
Purp1e
2024-11-11 10:04:00 +08:00
parent e308309fb8
commit b1d505fd6b
36 changed files with 353 additions and 218 deletions

View File

@@ -1,27 +1,27 @@
"use client"
import { CardButton } from "@/components/test/CardButton";
import { useGlobalShortcut } from "@/hooks/tauri/shortcuts";
import { invoke } from "@tauri-apps/api/core";
import { useCallback, useState } from "react";
import { CardButton } from "@/components/test/CardButton"
import { useGlobalShortcut } from "@/hooks/tauri/shortcuts"
import { invoke } from "@tauri-apps/api/core"
import { useCallback, useState } from "react"
export default function Page() {
const [buttonDesc, setButtonDesc] = useState<string>(
"Waiting to be clicked. This calls 'on_button_clicked' from Rust."
);
"Waiting to be clicked. This calls 'on_button_clicked' from Rust.",
)
const onButtonClick = () => {
invoke<string>("on_button_clicked")
.then((value) => {
setButtonDesc(value);
setButtonDesc(value)
})
.catch(() => {
setButtonDesc("Failed to invoke Rust command 'on_button_clicked'");
});
};
setButtonDesc("Failed to invoke Rust command 'on_button_clicked'")
})
}
const shortcutHandler = useCallback(() => {
console.log("Ctrl+P was pressed!");
}, []);
useGlobalShortcut("CommandOrControl+P", shortcutHandler);
console.log("Ctrl+P was pressed!")
}, [])
useGlobalShortcut("CommandOrControl+P", shortcutHandler)
return (
<div className="flex flex-col">
@@ -54,5 +54,5 @@ export default function Page() {
</div>
</main>
</div>
);
)
}