Remove test/protos symlink, use window.PROTO_ROOT for config
This commit is contained in:
parent
f4aa6d93a7
commit
3a3aa3efb6
6 changed files with 27 additions and 14 deletions
|
@ -37095,11 +37095,18 @@ Internal.SessionLock.queueJobForNumber = function queueJobForNumber(number, runJ
|
|||
window.textsecure.protobuf = {};
|
||||
|
||||
function loadProtoBufs(filename) {
|
||||
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) {
|
||||
var protos = result.build('textsecure');
|
||||
for (var protoName in protos) {
|
||||
textsecure.protobuf[protoName] = protos[protoName];
|
||||
}
|
||||
return dcodeIO.ProtoBuf.loadProtoFile({root: window.PROTO_ROOT, file: filename}, function(error, result) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
var protos = result.build('textsecure');
|
||||
if (!protos) {
|
||||
var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ')';
|
||||
throw new Error(text);
|
||||
}
|
||||
for (var protoName in protos) {
|
||||
textsecure.protobuf[protoName] = protos[protoName];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -4,14 +4,18 @@
|
|||
window.textsecure.protobuf = {};
|
||||
|
||||
function loadProtoBufs(filename) {
|
||||
return dcodeIO.ProtoBuf.loadProtoFile({root: 'protos', file: filename}, function(error, result) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
var protos = result.build('textsecure');
|
||||
for (var protoName in protos) {
|
||||
textsecure.protobuf[protoName] = protos[protoName];
|
||||
}
|
||||
return dcodeIO.ProtoBuf.loadProtoFile({root: window.PROTO_ROOT, file: filename}, function(error, result) {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
var protos = result.build('textsecure');
|
||||
if (!protos) {
|
||||
var text = 'Error loading protos from ' + filename + ' (root: ' + window.PROTO_ROOT + ')';
|
||||
throw new Error(text);
|
||||
}
|
||||
for (var protoName in protos) {
|
||||
textsecure.protobuf[protoName] = protos[protoName];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
console.log('preload');
|
||||
const electron = require('electron')
|
||||
|
||||
window.PROTO_ROOT = 'protos';
|
||||
window.config = require('url').parse(window.location.toString(), true).query;
|
||||
|
||||
const ipc = electron.ipcRenderer
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
*/
|
||||
mocha.setup("bdd");
|
||||
window.assert = chai.assert;
|
||||
window.PROTO_ROOT = '../protos';
|
||||
|
||||
(function() {
|
||||
var OriginalReporter = mocha._reporter;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../protos/
|
|
@ -12215,6 +12215,7 @@ Library.prototype.test = function(obj, type) {
|
|||
*/
|
||||
mocha.setup("bdd");
|
||||
window.assert = chai.assert;
|
||||
window.PROTO_ROOT = '../protos';
|
||||
|
||||
(function() {
|
||||
var OriginalReporter = mocha._reporter;
|
||||
|
|
Loading…
Add table
Reference in a new issue