(event, filePath)
| 7472 | } catch (error) { |
| 7473 | console.error('Error getting app version:', error); |
| 7474 | return null; |
| 7475 | } |
| 7476 | }); |
| 7477 | |
| 7478 | // Add error handling to the saveSetting handler |
| 7479 | const saveSettingHandler = async (event, key, value) => { |
| 7480 | try { |
| 7481 | console.log('Main Process - Saving setting:', key, value); |
| 7482 | |
| 7483 | // Ensure database is initialized |
| 7484 | if (!db) { |
| 7485 | console.error('Database not initialized when saving setting'); |
| 7486 | return false; |
| 7487 | } |
| 7488 | |
| 7489 | // If this is the CollectUsage setting being changed, track the change |
| 7490 | if (key === 'CollectUsage') { |
| 7491 | const oldValue = cachedPrepare('SELECT value FROM settings WHERE key = ?').get(key)?.value; |
| 7492 | console.log('CollectUsage - Old value:', oldValue, 'New value:', value); |
| 7493 | |
| 7494 | // If turning on analytics and it was previously off, track this event |
nothing calls this directly
no test coverage detected