[dep] update to eslint 9
This commit is contained in:
@@ -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>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user