fix: 🐛 IPC post message origin should depend on electron env
This commit is contained in:
2 files changed
+8
-1
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user