@@ -7,8 +7,9 @@ import platformAdapter from "@/utils/platformAdapter";
77import { Get } from "@/api/axiosRequest" ;
88import type { Assistant } from "@/types/chat" ;
99import { useAppStore } from "@/stores/appStore" ;
10- import { navigateBack } from "@/utils" ;
10+ import { canNavigateBack , navigateBack } from "@/utils" ;
1111import { useKeyPress } from "ahooks" ;
12+ import { useShortcutsStore } from "@/stores/shortcutsStore" ;
1213
1314interface AssistantManagerProps {
1415 isChatMode : boolean ;
@@ -49,6 +50,7 @@ export function useAssistantManager({
4950 } , [ quickAiAccessAssistant , selectedAssistant ] ) ;
5051
5152 const [ assistantDetail , setAssistantDetail ] = useState < any > ( { } ) ;
53+ const { modifierKey } = useShortcutsStore ( ) ;
5254
5355 useEffect ( ( ) => {
5456 if ( goAskAi ) return ;
@@ -78,7 +80,7 @@ export function useAssistantManager({
7880 } , [ askAI ?. id , askAI ?. querySource ?. id , disabledExtensions ] ) ;
7981
8082 const handleAskAi = useCallback ( ( ) => {
81- if ( ! isTauri ) return ;
83+ if ( ! isTauri || canNavigateBack ( ) ) return ;
8284
8385 if ( disabledExtensions . includes ( "QuickAIAccess" ) ) return ;
8486
@@ -206,6 +208,11 @@ export function useAssistantManager({
206208 setSourceData ( selectedSearchContent ) ;
207209 } ) ;
208210
211+ useKeyPress ( `${ modifierKey } .enter` , ( ) => {
212+ assistant_get ( ) ;
213+ return handleAskAi ( ) ;
214+ } ) ;
215+
209216 return {
210217 askAI,
211218 askAIRef,
0 commit comments