@@ -8,7 +8,7 @@ import { isMac } from "@/utils/platform";
88import {
99 INITIAL_MODE_SWITCH ,
1010 INITIAL_RETURN_TO_INPUT ,
11- // INITIAL_VOICE_INPUT,
11+ INITIAL_VOICE_INPUT ,
1212 // INITIAL_ADD_FILE,
1313 INITIAL_DEEP_THINKING ,
1414 INITIAL_INTERNET_SEARCH ,
@@ -37,61 +37,44 @@ export const modifierKeys: ModifierKey[] = isMac
3737
3838const Shortcuts = ( ) => {
3939 const { t } = useTranslation ( ) ;
40- const modifierKey = useShortcutsStore ( ( state ) => state . modifierKey ) ;
41- const setModifierKey = useShortcutsStore ( ( state ) => state . setModifierKey ) ;
42- const modeSwitch = useShortcutsStore ( ( state ) => state . modeSwitch ) ;
43- const setModeSwitch = useShortcutsStore ( ( state ) => state . setModeSwitch ) ;
44- const returnToInput = useShortcutsStore ( ( state ) => state . returnToInput ) ;
45- const setReturnToInput = useShortcutsStore ( ( state ) => state . setReturnToInput ) ;
46- // const voiceInput = useShortcutsStore((state) => state.voiceInput);
47- // const setVoiceInput = useShortcutsStore((state) => state.setVoiceInput);
48- // const addFile = useShortcutsStore((state) => state.addFile);
49- // const setAddFile = useShortcutsStore((state) => state.setAddFile);
50- const deepThinking = useShortcutsStore ( ( state ) => state . deepThinking ) ;
51- const setDeepThinking = useShortcutsStore ( ( state ) => state . setDeepThinking ) ;
52- const internetSearch = useShortcutsStore ( ( state ) => state . internetSearch ) ;
53- const setInternetSearch = useShortcutsStore ( ( state ) => {
54- return state . setInternetSearch ;
55- } ) ;
56- const internetSearchScope = useShortcutsStore ( ( state ) => {
57- return state . internetSearchScope ;
58- } ) ;
59- const setInternetSearchScope = useShortcutsStore ( ( state ) => {
60- return state . setInternetSearchScope ;
61- } ) ;
62- const mcpSearch = useShortcutsStore ( ( state ) => state . mcpSearch ) ;
63- const setMcpSearch = useShortcutsStore ( ( state ) => {
64- return state . setMcpSearch ;
65- } ) ;
66- const mcpSearchScope = useShortcutsStore ( ( state ) => {
67- return state . mcpSearchScope ;
68- } ) ;
69- const setMcpSearchScope = useShortcutsStore ( ( state ) => {
70- return state . setMcpSearchScope ;
71- } ) ;
72- const historicalRecords = useShortcutsStore ( ( state ) => {
73- return state . historicalRecords ;
74- } ) ;
75- const setHistoricalRecords = useShortcutsStore ( ( state ) => {
76- return state . setHistoricalRecords ;
77- } ) ;
78- const aiAssistant = useShortcutsStore ( ( state ) => {
79- return state . aiAssistant ;
80- } ) ;
81- const setAiAssistant = useShortcutsStore ( ( state ) => {
82- return state . setAiAssistant ;
83- } ) ;
84- const newSession = useShortcutsStore ( ( state ) => state . newSession ) ;
85- const setNewSession = useShortcutsStore ( ( state ) => state . setNewSession ) ;
86- const fixedWindow = useShortcutsStore ( ( state ) => state . fixedWindow ) ;
87- const setFixedWindow = useShortcutsStore ( ( state ) => state . setFixedWindow ) ;
88- const serviceList = useShortcutsStore ( ( state ) => state . serviceList ) ;
89- const setServiceList = useShortcutsStore ( ( state ) => state . setServiceList ) ;
90- const external = useShortcutsStore ( ( state ) => state . external ) ;
91- const setExternal = useShortcutsStore ( ( state ) => state . setExternal ) ;
92- const addError = useAppStore ( ( state ) => state . addError ) ;
93- const aiOverview = useShortcutsStore ( ( state ) => state . aiOverview ) ;
94- const setAiOverview = useShortcutsStore ( ( state ) => state . setAiOverview ) ;
40+ const {
41+ modifierKey,
42+ setModifierKey,
43+ modeSwitch,
44+ setModeSwitch,
45+ returnToInput,
46+ setReturnToInput,
47+ voiceInput,
48+ setVoiceInput,
49+ // addFile,
50+ // setAddFile,
51+ deepThinking,
52+ setDeepThinking,
53+ internetSearch,
54+ setInternetSearch,
55+ internetSearchScope,
56+ setInternetSearchScope,
57+ mcpSearch,
58+ setMcpSearch,
59+ mcpSearchScope,
60+ setMcpSearchScope,
61+ historicalRecords,
62+ setHistoricalRecords,
63+ aiAssistant,
64+ setAiAssistant,
65+ newSession,
66+ setNewSession,
67+ fixedWindow,
68+ setFixedWindow,
69+ serviceList,
70+ setServiceList,
71+ external,
72+ setExternal,
73+ aiOverview,
74+ setAiOverview,
75+ } = useShortcutsStore ( ) ;
76+
77+ const { addError } = useAppStore ( ) ;
9578
9679 useEffect ( ( ) => {
9780 const unlisten = useShortcutsStore . subscribe ( ( state ) => {
@@ -116,15 +99,13 @@ const Shortcuts = () => {
11699 value : returnToInput ,
117100 setValue : setReturnToInput ,
118101 } ,
119- // {
120- // title: "settings.advanced.shortcuts.voiceInput.title",
121- // description: "settings.advanced.shortcuts.voiceInput.description",
122- // value: voiceInput,
123- // setValue: setVoiceInput,
124- // reset: () => {
125- // handleChange(INITIAL_VOICE_INPUT, setVoiceInput);
126- // },
127- // },
102+ {
103+ title : "settings.advanced.shortcuts.voiceInput.title" ,
104+ description : "settings.advanced.shortcuts.voiceInput.description" ,
105+ initialValue : INITIAL_VOICE_INPUT ,
106+ value : voiceInput ,
107+ setValue : setVoiceInput ,
108+ } ,
128109 // {
129110 // title: "settings.advanced.shortcuts.addFile.title",
130111 // description: "settings.advanced.shortcuts.addFile.description",
0 commit comments