Move wrapDeferred from background.js to preload.js
It's necessary anywhere that will have to deal with Deferreds.
This commit is contained in:
parent
a824e2b42d
commit
3a151393c5
2 changed files with 5 additions and 6 deletions
|
@ -22,12 +22,6 @@
|
||||||
console.log(e);
|
console.log(e);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.wrapDeferred = function(deferred) {
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
deferred.then(resolve, reject);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
console.log('background page reloaded');
|
console.log('background page reloaded');
|
||||||
console.log('environment:', window.config.environment);
|
console.log('environment:', window.config.environment);
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
|
|
||||||
window.PROTO_ROOT = 'protos';
|
window.PROTO_ROOT = 'protos';
|
||||||
window.config = require('url').parse(window.location.toString(), true).query;
|
window.config = require('url').parse(window.location.toString(), true).query;
|
||||||
|
window.wrapDeferred = function(deferred) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
deferred.then(resolve, reject);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const ipc = electron.ipcRenderer;
|
const ipc = electron.ipcRenderer;
|
||||||
window.config.localeMessages = ipc.sendSync('locale-data');
|
window.config.localeMessages = ipc.sendSync('locale-data');
|
||||||
|
|
Loading…
Add table
Reference in a new issue