|
@ -424,17 +424,19 @@ async function fetchAllContacts() { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async function makeNotifications() { |
|
|
async function getNotificationCount() { |
|
|
const secret = localStorage.getItem('secret'); |
|
|
const secret = localStorage.getItem('secret'); |
|
|
const secretUint8Array = util.decodeBase64(secret); |
|
|
const secretUint8Array = util.decodeBase64(secret); |
|
|
|
|
|
|
|
|
const setting = await getSettingById(1); |
|
|
const settings = await getSettingById(1); |
|
|
|
|
|
const activeDid = settings['activeDid']; |
|
|
const accounts = await fetchAllAccounts(); |
|
|
const accounts = await fetchAllAccounts(); |
|
|
|
|
|
|
|
|
let results = []; |
|
|
let result = null; |
|
|
for (var i = 0; i < accounts.length; i++) { |
|
|
for (var i = 0; i < accounts.length; i++) { |
|
|
let account = accounts[i]; |
|
|
let account = accounts[i]; |
|
|
let did = account['did']; |
|
|
let did = account['did']; |
|
|
|
|
|
if (did == activeDid) { |
|
|
let publicKeyHex = account['publicKeyHex']; |
|
|
let publicKeyHex = account['publicKeyHex']; |
|
|
let identity = account['identity']; |
|
|
let identity = account['identity']; |
|
|
|
|
|
|
|
@ -459,15 +461,15 @@ async function makeNotifications() { |
|
|
|
|
|
|
|
|
if (response.status_code =- 200) { |
|
|
if (response.status_code =- 200) { |
|
|
data = response.json()['data'] |
|
|
data = response.json()['data'] |
|
|
results.push({ [did]: data.length }) |
|
|
result = { [did]: data.length }; |
|
|
} |
|
|
} |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
return { "headers": headers } |
|
|
} |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
module.exports = { |
|
|
makeNotifications |
|
|
getNotificationCount |
|
|
}; |
|
|
}; |