()
| 11791 | if (apiKeyEl && selectedService !== 'puter') { |
| 11792 | apiKeyEl.value = ''; |
| 11793 | } |
| 11794 | |
| 11795 | // Save the new values to the database |
| 11796 | await window.electron.saveSetting('apiEndpoint', endpointEl.value).catch(err => console.error('Error saving endpoint:', err)); |
| 11797 | await window.electron.saveSetting('aiModel', modelEl.value).catch(err => console.error('Error saving model:', err)); |
| 11798 | await window.electron.saveSetting('aiService', selectedService).catch(err => console.error('Error saving service:', err)); |
| 11799 | console.log('[AI Config] Service changed to:', selectedService, 'and saved to database'); |
| 11800 | }); |
| 11801 | |
| 11802 | // Add missing function renderThumbnail used in generateThumbnail(). |
| 11803 | async function renderThumbnail(file) { |
| 11804 | try { |
| 11805 | // Determine filePath: if file is a string, use it directly; otherwise, assume it's an object with filePath property. |
| 11806 | const filePath = (typeof file === 'string') ? file : file.filePath; |
| 11807 | if (!filePath) { |
| 11808 | throw new Error("renderThumbnail: filePath is undefined"); |
no outgoing calls
no test coverage detected