Browse Source

test

hosting-provider
Evan Feenstra 5 years ago
parent
commit
fd8f149c2e
  1. 2
      api/network/send.ts
  2. 1
      api/utils/tribes.ts
  3. 2
      dist/api/network/send.js
  4. 2
      dist/api/network/send.js.map
  5. 1
      dist/api/utils/tribes.js
  6. 2
      dist/api/utils/tribes.js.map

2
api/network/send.ts

@ -107,6 +107,7 @@ export function signAndSend(opts, mqttTopic?:string){
try { try {
if(mqttTopic) { if(mqttTopic) {
await tribes.publish(mqttTopic, data, function(){ await tribes.publish(mqttTopic, data, function(){
console.log("PUB HERE")
if(mqttTopic) checkIfConfirmation(data) if(mqttTopic) checkIfConfirmation(data)
}) })
} else { } else {
@ -120,6 +121,7 @@ export function signAndSend(opts, mqttTopic?:string){
} }
function checkIfConfirmation(data){ function checkIfConfirmation(data){
console.log("checkIfConfirmation",data)
if(data.type===constants.message_types.confirmation) { if(data.type===constants.message_types.confirmation) {
tribeOwnerAutoConfirmation(data.message.id) tribeOwnerAutoConfirmation(data.message.id)
} }

1
api/utils/tribes.ts

@ -67,6 +67,7 @@ export function subscribe(topic) {
export function publish(topic, msg, cb) { export function publish(topic, msg, cb) {
if (client) client.publish(topic, msg, null, function(err){ if (client) client.publish(topic, msg, null, function(err){
console.log("CALLBACK")
if(err) console.log(err) if(err) console.log(err)
else if(cb) cb() else if(cb) cb()
}) })

2
dist/api/network/send.js

@ -115,6 +115,7 @@ function signAndSend(opts, mqttTopic) {
try { try {
if (mqttTopic) { if (mqttTopic) {
yield tribes.publish(mqttTopic, data, function () { yield tribes.publish(mqttTopic, data, function () {
console.log("PUB HERE");
if (mqttTopic) if (mqttTopic)
checkIfConfirmation(data); checkIfConfirmation(data);
}); });
@ -132,6 +133,7 @@ function signAndSend(opts, mqttTopic) {
} }
exports.signAndSend = signAndSend; exports.signAndSend = signAndSend;
function checkIfConfirmation(data) { function checkIfConfirmation(data) {
console.log("checkIfConfirmation", data);
if (data.type === constants.message_types.confirmation) { if (data.type === constants.message_types.confirmation) {
confirmations_1.tribeOwnerAutoConfirmation(data.message.id); confirmations_1.tribeOwnerAutoConfirmation(data.message.id);
} }

2
dist/api/network/send.js.map

File diff suppressed because one or more lines are too long

1
dist/api/utils/tribes.js

@ -82,6 +82,7 @@ exports.subscribe = subscribe;
function publish(topic, msg, cb) { function publish(topic, msg, cb) {
if (client) if (client)
client.publish(topic, msg, null, function (err) { client.publish(topic, msg, null, function (err) {
console.log("CALLBACK");
if (err) if (err)
console.log(err); console.log(err);
else if (cb) else if (cb)

2
dist/api/utils/tribes.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save