fix: 🐛 IPC post message origin should depend on electron env

This commit is contained in:
Randall Morey committed 2020-11-10 13:32:39 -05:00
1 parent fbfda37908
commit da79a17359
2 files changed
+8 -1

No files matched your search

+2 -1
View File
@@ -1,6 +1,7 @@
import Service from '@ember/service';
import { getOwner } from '@ember/application';
import { Promise } from 'rsvp';
import config from '../config/environment';
/**
* An IPC request is a promise-like object that issues a request via
@@ -56,7 +57,7 @@ export class IPCRequest {
* @param {Window} window - A reference to the window object
* @param {?string} origin
*/
constructor(method, payload, window, origin='serve://boundary') {
constructor(method, payload, window, origin=config.ipc.defaultOrigin) {
this.method = method;
this.payload = payload;
this.origin = origin;
+6
View File
@@ -31,6 +31,12 @@ module.exports = function (environment) {
namespace: 'v1',
},
ipc: {
defaultOrigin: process.env.EMBER_CLI_ELECTRON
? 'serve://boundary'
: 'http://localhost:4200'
},
appName: APP_NAME,
};