@prifina/messaging
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -361,14 +361,18 @@ 'use strict'; | ||
if (msgStatus !== null && JSON.parse(msgStatus)) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
var unreadMsgs = msgStatusQueue.filter(function (m) { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString() | ||
} | ||
}); | ||
if (msgStatus !== null) { | ||
var msgSubs = JSON.parse(msgStatus); // uuid has subscribed notifications.... | ||
if (msgSubs.hasOwnProperty(uuid) && msgSubs[uuid]) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
var unreadMsgs = msgStatusQueue.filter(function (m) { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString() | ||
} | ||
}); | ||
} | ||
} | ||
@@ -397,7 +401,15 @@ | ||
_ref7.createSubscription; | ||
_ref7.variables; | ||
var variables = _ref7.variables; | ||
_ref7.uuid; | ||
if (stage === "dev") { | ||
localStorage.setItem("prifinaMessagingStatus", true); | ||
var msgStatus = localStorage.getItem("prifinaMessagingStatus"); | ||
var msgSubs = {}; | ||
if (msgStatus !== null) { | ||
msgSubs = JSON.parse(msgStatus); | ||
} | ||
msgSubs[variables.receiver] = true; | ||
localStorage.setItem("prifinaMessagingStatus", JSON.stringify(msgSubs)); | ||
return Promise.resolve(true); | ||
@@ -404,0 +416,0 @@ } else { |
@@ -357,14 +357,18 @@ import { typeof as _typeof } from './_virtual/_rollupPluginBabelHelpers.js'; | ||
if (msgStatus !== null && JSON.parse(msgStatus)) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
var unreadMsgs = msgStatusQueue.filter(function (m) { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString() | ||
} | ||
}); | ||
if (msgStatus !== null) { | ||
var msgSubs = JSON.parse(msgStatus); // uuid has subscribed notifications.... | ||
if (msgSubs.hasOwnProperty(uuid) && msgSubs[uuid]) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
var unreadMsgs = msgStatusQueue.filter(function (m) { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString() | ||
} | ||
}); | ||
} | ||
} | ||
@@ -393,7 +397,15 @@ | ||
_ref7.createSubscription; | ||
_ref7.variables; | ||
var variables = _ref7.variables; | ||
_ref7.uuid; | ||
if (stage === "dev") { | ||
localStorage.setItem("prifinaMessagingStatus", true); | ||
var msgStatus = localStorage.getItem("prifinaMessagingStatus"); | ||
var msgSubs = {}; | ||
if (msgStatus !== null) { | ||
msgSubs = JSON.parse(msgStatus); | ||
} | ||
msgSubs[variables.receiver] = true; | ||
localStorage.setItem("prifinaMessagingStatus", JSON.stringify(msgSubs)); | ||
return Promise.resolve(true); | ||
@@ -400,0 +412,0 @@ } else { |
{ | ||
"name": "@prifina/messaging", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Prifina Messaging Component", | ||
@@ -51,3 +51,3 @@ "author": "Tero <tero@prifina.com>", | ||
}, | ||
"gitHead": "d2fb9674d2cdfa28e50aaace6922efcd79fe0cd6" | ||
"gitHead": "2e0f6712e635fcc3fec61157171eab434a873354" | ||
} |
@@ -353,14 +353,18 @@ export const getInfo = () => { | ||
const msgStatus = localStorage.getItem("prifinaMessagingStatus"); | ||
if (msgStatus !== null && JSON.parse(msgStatus)) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
const unreadMsgs = msgStatusQueue.filter((m) => { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString(), | ||
}, | ||
}); | ||
if (msgStatus !== null) { | ||
const msgSubs = JSON.parse(msgStatus); | ||
// uuid has subscribed notifications.... | ||
if (msgSubs.hasOwnProperty(uuid) && msgSubs[uuid]) { | ||
//console.log("CALLBACKS ", currentCallbacks[appID][0]("OK")); | ||
// scan msgStatusQueue instead... where status===0 | ||
const unreadMsgs = msgStatusQueue.filter((m) => { | ||
return m.uuid === uuid; | ||
}); | ||
currentCallbacks[appID][0]({ | ||
messagingStatus: { | ||
cnt: unreadMsgs.length, | ||
lastMessage: new Date(msg.createdAt).toISOString(), | ||
}, | ||
}); | ||
} | ||
} | ||
@@ -392,3 +396,9 @@ | ||
if (stage === "dev") { | ||
localStorage.setItem("prifinaMessagingStatus", true); | ||
const msgStatus = localStorage.getItem("prifinaMessagingStatus"); | ||
let msgSubs = {}; | ||
if (msgStatus !== null) { | ||
msgSubs = JSON.parse(msgStatus); | ||
} | ||
msgSubs[variables.receiver] = true; | ||
localStorage.setItem("prifinaMessagingStatus", JSON.stringify(msgSubs)); | ||
return Promise.resolve(true); | ||
@@ -395,0 +405,0 @@ } else { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41364
1300