diff --git a/src/main/index.ts b/src/main/index.ts index 2db1f6a9..e5ca6772 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -2,18 +2,27 @@ require('v8-compile-cache'); import {app, components, ipcMain} from 'electron'; import {join} from 'path'; -app.setPath('userData', join(app.getPath('appData'), 'Cider')); +if (!app.isPackaged) { + app.setPath('userData', join(app.getPath('appData'), 'Cider')); +} -// Analytics for debugging fun yeah. -import {init as Sentry} from '@sentry/electron'; import {Store} from "./base/store"; import {AppEvents} from "./base/app"; import {Plugins} from "./base/plugins"; -import {utils} from "./base/utils"; import {BrowserWindow} from "./base/browserwindow"; +import {init as Sentry} from '@sentry/electron'; +import {RewriteFrames} from "@sentry/integrations"; -Sentry({dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214"}); +// Analytics for debugging fun yeah. +Sentry({ + dsn: "https://68c422bfaaf44dea880b86aad5a820d2@o954055.ingest.sentry.io/6112214", + integrations: [ + new RewriteFrames({ + root: process.cwd(), + }), + ], +}); new Store(); const Cider = new AppEvents(); @@ -49,11 +58,11 @@ app.on('ready', () => { * Renderer Event Handlers * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -ipcMain.on('playbackStateDidChange', (event, attributes) => { +ipcMain.on('playbackStateDidChange', (_event, attributes) => { CiderPlug.callPlugins('onPlaybackStateDidChange', attributes); }); -ipcMain.on('nowPlayingItemDidChange', (event, attributes) => { +ipcMain.on('nowPlayingItemDidChange', (_event, attributes) => { CiderPlug.callPlugins('onNowPlayingItemDidChange', attributes); });