feat: open settings via command comma (#436)

This commit is contained in:
TinsFox
2025-12-28 22:52:51 +08:00
committed by GitHub
parent 9716eb797f
commit 7fdaeacb5b
+15
View File
@@ -262,6 +262,21 @@ function App() {
checkEnvOnSwitch();
}, [activeApp]);
useEffect(() => {
const handleGlobalShortcut = (event: KeyboardEvent) => {
if (event.key !== "," || !(event.metaKey || event.ctrlKey)) {
return;
}
event.preventDefault();
setCurrentView("settings");
};
window.addEventListener("keydown", handleGlobalShortcut);
return () => {
window.removeEventListener("keydown", handleGlobalShortcut);
};
}, []);
// 打开网站链接
const handleOpenWebsite = async (url: string) => {
try {