fix: remove esc key listener in macOS

This commit is contained in:
GyDi 2023-03-16 20:42:45 +08:00
parent 6c0066dbfb
commit 66d93ea037
No known key found for this signature in database
GPG Key ID: 9C3AD40F1F99880A

View File

@ -35,9 +35,9 @@ const Layout = () => {
useEffect(() => {
window.addEventListener("keydown", (e) => {
if (e.key === "Escape") {
if (OS === "macos") appWindow.hide();
else appWindow.close();
// macOS有cmd+w
if (e.key === "Escape" && OS !== "macos") {
appWindow.close();
}
});