mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
@@ -27,7 +27,9 @@ export function registerAffineLayoutCommands({
|
||||
binding: '$mod+/',
|
||||
},
|
||||
run() {
|
||||
track.$.navigationPanel.$.toggle();
|
||||
track.$.navigationPanel.$.toggle({
|
||||
type: appSidebarService.sidebar.open$.value ? 'collapse' : 'expand',
|
||||
});
|
||||
appSidebarService.sidebar.toggleSidebar();
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { IconButton } from '@affine/component';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { SidebarIcon } from '@blocksuite/icons/rc';
|
||||
import { useLiveData, useService } from '@toeverything/infra';
|
||||
import { useCallback, useRef } from 'react';
|
||||
@@ -27,6 +28,9 @@ export const SidebarSwitch = ({
|
||||
}, [appSidebarService, open, preventHovering]);
|
||||
|
||||
const handleClickSwitch = useCallback(() => {
|
||||
track.$.navigationPanel.$.toggle({
|
||||
type: open ? 'collapse' : 'expand',
|
||||
});
|
||||
if (timeoutRef.current) {
|
||||
clearTimeout(timeoutRef.current);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user