-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved plugin directory to
userData
folder (#238)
- Loading branch information
Showing
3 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "salad", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Salad Technologies Desktop Application", | ||
"author": "Salad Technologies <[email protected]>", | ||
"homepage": "https://www.salad.io/", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,14 @@ import { PluginManager } from './salad-bowl/PluginManager' | |
import { PluginDefinition } from './salad-bowl/models/PluginDefinition' | ||
import { SaladBridgeNotificationService } from './salad-bowl/SaladBridgeNotificationService' | ||
import * as Sentry from '@sentry/electron' | ||
import { Profile } from './models/Profile' | ||
|
||
Sentry.init({ dsn: 'https://[email protected]/1804227' }) | ||
const appVersion = app.getVersion() | ||
|
||
Sentry.init({ | ||
dsn: 'https://[email protected]/1804227', | ||
release: appVersion, | ||
}) | ||
|
||
/** Path to the /static folder. Provided via electron-webpack */ | ||
declare const __static: string | ||
|
@@ -149,10 +155,9 @@ const createMainWindow = () => { | |
//Create the bridge to listen to messages from the web-app | ||
let bridge = new SaladBridge(mainWindow) | ||
let notificationService = new SaladBridgeNotificationService(bridge) | ||
let exePath = app.getPath('exe') | ||
let appPath = path.dirname(exePath) | ||
console.log(`Path to Salad:${appPath}`) | ||
pluginManager = new PluginManager(appPath, notificationService) | ||
let dataFolder = app.getPath('userData') | ||
console.log(`Path to Salad plugins:${dataFolder}`) | ||
pluginManager = new PluginManager(dataFolder, notificationService) | ||
|
||
ipcMain.on('js-dispatch', bridge.receiveMessage) | ||
|
||
|
@@ -225,6 +230,22 @@ const createMainWindow = () => { | |
saladAutoLauncher.disable() | ||
}) | ||
|
||
bridge.on('login', (profile: Profile) => { | ||
Sentry.configureScope(scope => { | ||
scope.setUser({ | ||
id: profile.id, | ||
email: profile.email, | ||
username: profile.username, | ||
}) | ||
}) | ||
}) | ||
|
||
bridge.on('logout', () => { | ||
Sentry.configureScope(scope => { | ||
scope.setUser({}) | ||
}) | ||
}) | ||
|
||
mainWindow.webContents.on('new-window', (e: Electron.Event, url: string) => { | ||
console.log(`opening new window at ${url}`) | ||
e.preventDefault() | ||
|
@@ -344,4 +365,4 @@ const cleanExit = () => { | |
|
||
process.on('SIGINT', cleanExit) // catch ctrl-c | ||
process.on('SIGTERM', cleanExit) // catch kill | ||
console.log(`Running ${app.name} ${app.getVersion()}`) | ||
console.log(`Running ${app.name} ${appVersion}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface Profile { | ||
id: string | ||
username: string | ||
email: string | ||
} |