1- import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow" ;
1+ import { Button } from "@hypr/ui/components/ui/button" ;
2+ import { cn } from "@hypr/utils" ;
3+
24import { ArrowLeftIcon , ArrowRightIcon , PanelLeftOpenIcon , PlusIcon } from "lucide-react" ;
35import { Reorder } from "motion/react" ;
46import { useCallback , useEffect , useRef } from "react" ;
57import { useHotkeys } from "react-hotkeys-hook" ;
68import { useShallow } from "zustand/shallow" ;
79
8- import { Button } from "@hypr/ui/components/ui/button" ;
9- import { cn } from "@hypr/utils" ;
1010import { useShell } from "../../../contexts/shell" ;
1111import { type Tab , uniqueIdfromTab , useTabs } from "../../../store/zustand/tabs" ;
1212import { ChatFloatingButton } from "../../chat" ;
@@ -376,16 +376,12 @@ function useTabsShortcuts() {
376376 ( ) => {
377377 if ( currentTab ?. type === "empty" ) {
378378 newNoteCurrent ( ) ;
379- return ;
380- }
381-
382- if ( currentTab ) {
383- close ( currentTab ) ;
379+ } else {
380+ newNote ( ) ;
384381 }
385- newNote ( ) ;
386382 } ,
387383 { preventDefault : true , enableOnFormTags : true , enableOnContentEditable : true } ,
388- [ currentTab , close , newNote , newNoteCurrent ] ,
384+ [ currentTab , newNote , newNoteCurrent ] ,
389385 ) ;
390386
391387 useHotkeys (
@@ -398,15 +394,12 @@ function useTabsShortcuts() {
398394 useHotkeys (
399395 "mod+w" ,
400396 async ( ) => {
401- if ( currentTab && tabs . length > 1 ) {
397+ if ( currentTab ) {
402398 close ( currentTab ) ;
403- } else {
404- const appWindow = getCurrentWebviewWindow ( ) ;
405- await appWindow . close ( ) ;
406399 }
407400 } ,
408401 { preventDefault : true , enableOnFormTags : true , enableOnContentEditable : true } ,
409- [ tabs , currentTab , close ] ,
402+ [ currentTab , close ] ,
410403 ) ;
411404
412405 useHotkeys (
0 commit comments