mirror of
https://github.com/jeffvli/feishin.git
synced 2026-12-03 23:32:24 -08:00
fix: remove duplicate CommandPalette in mobile layout (#1669)
The CommandPalette component was being rendered twice when in mobile view: 1. In ResponsiveLayout via LayoutHotkeys (which handles all layouts) 2. In MobileLayout directly This caused two overlapping command menus to open when pressing Ctrl+K in mobile view, with keyboard input going to the background menu. The fix removes the duplicate CommandPalette from MobileLayout since LayoutHotkeys already provides it for all layouts (both desktop and mobile). Fixes #1666 Co-authored-by: Kai Gritun <[email protected]>
This commit is contained in:
1 parent
fb170bb7c4
commit
397610d8ab
1 file changed
+1
-4
@@ -8,11 +8,10 @@ import styles from './mobile-layout.module.css';
|
||||
import { ContextMenuController } from '/@/renderer/features/context-menu/context-menu-controller';
|
||||
import { FullScreenVisualizer } from '/@/renderer/features/player/components/full-screen-visualizer';
|
||||
import { MobileFullscreenPlayer } from '/@/renderer/features/player/components/mobile-fullscreen-player';
|
||||
import { CommandPalette } from '/@/renderer/features/search/components/command-palette';
|
||||
import { MobileSidebar } from '/@/renderer/features/sidebar/components/mobile-sidebar';
|
||||
import { PlayerBar } from '/@/renderer/layouts/default-layout/player-bar';
|
||||
import { useFullScreenPlayerStore } from '/@/renderer/store';
|
||||
import { useCommandPalette, useWindowSettings } from '/@/renderer/store';
|
||||
import { useWindowSettings } from '/@/renderer/store';
|
||||
import { ActionIcon } from '/@/shared/components/action-icon/action-icon';
|
||||
import { Drawer } from '/@/shared/components/drawer/drawer';
|
||||
import { useDisclosure } from '/@/shared/hooks/use-disclosure';
|
||||
@@ -29,7 +28,6 @@ interface MobileLayoutProps {
|
||||
}
|
||||
|
||||
export const MobileLayout = ({ shell }: MobileLayoutProps) => {
|
||||
const { opened, ...handlers } = useCommandPalette();
|
||||
const [sidebarOpened, { close: closeSidebar, open: openSidebar }] = useDisclosure(false);
|
||||
const {
|
||||
expanded: isFullScreenPlayerExpanded,
|
||||
@@ -93,7 +91,6 @@ export const MobileLayout = ({ shell }: MobileLayoutProps) => {
|
||||
</div>
|
||||
)}
|
||||
</AnimatePresence>
|
||||
<CommandPalette modalProps={{ handlers, opened }} />
|
||||
<ContextMenuController.Root />
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user