File tree Expand file tree Collapse file tree 2 files changed +23
-32
lines changed
Expand file tree Collapse file tree 2 files changed +23
-32
lines changed Original file line number Diff line number Diff line change @@ -38,14 +38,20 @@ export default function openAIAssistantPage() {
3838 let currentController = null ;
3939 let aiTabInstance ;
4040
41- if ( ! settings . value . aiApiKey ) {
42- alert ( "Error" , "Please set your AI Assistant API Key in Settings before using the assistant." ) ;
43- return ;
44- }
45- if ( ! settings . value . aiModel ) {
46- alert ( "Error" , "Please set your AI Assistant model in Settings before using the assistant." ) ;
47- return ;
48- }
41+ if ( ! settings . value . aiApiKey ) {
42+ alert (
43+ "Error" ,
44+ "Please set your AI Assistant API Key in Settings before using the assistant." ,
45+ ) ;
46+ return ;
47+ }
48+ if ( ! settings . value . aiModel ) {
49+ alert (
50+ "Error" ,
51+ "Please set your AI Assistant model in Settings before using the assistant." ,
52+ ) ;
53+ return ;
54+ }
4955
5056 const agentCheckpointer = new CordovaSqliteSaver ( ) ;
5157 const model = new ChatGoogleGenerativeAI ( {
Original file line number Diff line number Diff line change @@ -72,24 +72,16 @@ export default function otherSettings() {
7272 select : [ appSettings . CONSOLE_LEGACY , appSettings . CONSOLE_ERUDA ] ,
7373 } ,
7474 {
75- key : "aiApiKey" ,
76- text : "AI Assistant API Key" ,
77- placeholder : "Enter your API key" ,
78- promptType : "text" ,
79- promptOptions : {
80- required : true
81- } ,
82- value : values . aiApiKey
75+ key : "aiApiKey" ,
76+ text : "AI Assistant API Key" ,
77+ value : values . aiApiKey ,
78+ prompt : "AI Assistant API Key" ,
8379 } ,
8480 {
85- key : "aiModel" ,
86- text : "AI Assistant Model" ,
87- placeholder : "Enter your model" ,
88- promptType : "text" ,
89- promptOptions : {
90- required : true
91- } ,
92- value : values . aiModel
81+ key : "aiModel" ,
82+ text : "AI Assistant Model" ,
83+ value : values . aiModel ,
84+ prompt : "AI Assistant Model" ,
9385 } ,
9486 {
9587 key : "keyboardMode" ,
@@ -253,16 +245,9 @@ export default function otherSettings() {
253245 } catch ( error ) {
254246 helpers . error ( error ) ;
255247 }
248+ break ;
256249 }
257250
258- case "aiApiKey" :
259- await appSettings . update ( { aiApiKey : value } ) ;
260- break ;
261-
262- case "aiModel" :
263- await appSettings . update ( { aiModel : value } ) ;
264- break ;
265-
266251 case "rememberFiles" :
267252 if ( ! value ) {
268253 delete localStorage . files ;
You can’t perform that action at this time.
0 commit comments