mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Merge pull request #276 from QuickMythril/invite-expiry
Filter expired invites
This commit is contained in:
commit
37dcd444e8
@ -1769,14 +1769,16 @@ class GroupManagement extends LitElement {
|
|||||||
clearTimeout(timerGroupInvites)
|
clearTimeout(timerGroupInvites)
|
||||||
timerGroupInvites = setTimeout(getGroupInvites, 300000)
|
timerGroupInvites = setTimeout(getGroupInvites, 300000)
|
||||||
} else {
|
} else {
|
||||||
this.myGroupInvites.map(a => {
|
const currentTime = Date.now()
|
||||||
|
this.myGroupInvites.forEach(a => {
|
||||||
|
if (a.expiry > currentTime) {
|
||||||
let callTheNewInviteUrl = `${nodeUrl}/groups/${a.groupId}`
|
let callTheNewInviteUrl = `${nodeUrl}/groups/${a.groupId}`
|
||||||
fetch(callTheNewInviteUrl).then(res => {
|
fetch(callTheNewInviteUrl).then(res => {
|
||||||
return res.json()
|
return res.json()
|
||||||
}).then(jsonRes => {
|
}).then(jsonRes => {
|
||||||
myArrObj.push(jsonRes)
|
myArrObj.push(jsonRes)
|
||||||
if (myArrObj.length) {
|
if (myArrObj.length) {
|
||||||
myArrObj.map(b => {
|
myArrObj.forEach(b => {
|
||||||
const infoObjToAdd = {
|
const infoObjToAdd = {
|
||||||
invitee: a.invitee,
|
invitee: a.invitee,
|
||||||
groupId: b.groupId,
|
groupId: b.groupId,
|
||||||
@ -1793,6 +1795,7 @@ class GroupManagement extends LitElement {
|
|||||||
}
|
}
|
||||||
this.groupInvites = myInvitesObj
|
this.groupInvites = myInvitesObj
|
||||||
})
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
setTimeout(getGroupInvites, 300000)
|
setTimeout(getGroupInvites, 300000)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user