diff --git a/README.md b/README.md index 7b39719..c86f07c 100755 --- a/README.md +++ b/README.md @@ -70,7 +70,8 @@ Open the .dmg or .zip file and drag the Deep Focus app to your Applications fold - [x] Add onboarding flow to improve user comprehension - [x] Allow users to customize productive/unproductive sites - [ ] Add more comprehensive test suite for main and renderer processes - +- [ ] Add timeline view for daily email summaries +- [ ] Upload app to the App Store ## Philosophy diff --git a/src/main.ts b/src/main.ts index b99a622..8557a71 100644 --- a/src/main.ts +++ b/src/main.ts @@ -38,7 +38,7 @@ export interface TypedStore extends Store { delete(key: K): void clear(): void } - +const API_BASE_URL = 'https://backend-production-5eec.up.railway.app' const store = new Store() as TypedStore let currentSiteTimeTrackers: SiteTimeTracker[] = store.get('siteTimeTrackers', []) let monitoringInterval: NodeJS.Timeout | null = null @@ -131,7 +131,6 @@ async function storeData(): Promise { log.info( 'Periodic save triggered (updating siteTimeTrackers, deepWorkHours, currentDeepWork and icon): ' ) - log.info('Loaded API_BASE_URL:', process.env.VITE_SERVER_URL_PROD) store.set('siteTimeTrackers', currentSiteTimeTrackers) store.set('deepWorkHours', deepWorkHours) currentDeepWork = deepWorkHours[today] || 0 @@ -142,7 +141,6 @@ export async function resetCounters(type: 'daily' | 'weekly'): Promise { log.info('Invoked resetCounters') stopActivityMonitoring() - log.info('Loaded API_BASE_URL:', process.env.VITE_SERVER_URL_PROD) checkAndSendMissedEmails() if (type === 'daily') { @@ -360,11 +358,12 @@ app.whenReady().then(async () => { tray?.setContextMenu(trayMenu) } // TODO: Undecided if we want to show app on tray click - // tray.on('click', () => { - // if (mainWindow) { - // mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show() - // } - // }) + tray.on('click', () => { + // if (mainWindow) { + // mainWindow.isVisible() ? mainWindow.hide() : mainWindow.show() + // } + createTrayMenu() + }) }) app.on('ready', () => { @@ -419,7 +418,7 @@ app.on('window-all-closed', () => { const schedulerWorkerPath = join(__dirname, 'worker.js') const schedulerWorker = new Worker(schedulerWorkerPath, { workerData: { - API_BASE_URL: process.env.VITE_SERVER_URL_PROD + API_BASE_URL: API_BASE_URL } }) schedulerWorker.on('message', (message: any) => { @@ -659,7 +658,7 @@ async function sendDailyEmail() { } try { - const response = await fetch(`${process.env.VITE_SERVER_URL_PROD}/api/v1/activity/send-daily`, { + const response = await fetch(`${API_BASE_URL}/api/v1/activity/send-daily`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(dailyData)