Fix following groups

This commit is contained in:
aeroreyna
2023-01-22 22:42:18 -05:00
parent dadf070ac5
commit 47973879ab
2 changed files with 11 additions and 6 deletions

View File

@@ -286,13 +286,17 @@ userDB = (DB) => {
}
DB.getFollowingGroups = async (profileid) => {
const profile = await DB.getProfile(profileId);
const profile = await DB.getProfile(profileid);
let ids = [];
for(id in profile.following){
let oId = DB.ObjectID(id);
let checkProfile = await DB.getProfileCache(oId)
if(checkProfile && checkProfile.isGroup && !checkProfile.isChat){
ids.push(oId)
try{
let oId = DB.ObjectID(profile.following[id]);
let checkProfile = await DB.getProfileCache(oId)
if(checkProfile && checkProfile.isGroup && !checkProfile.isChat){
ids.push(oId)
}
}catch{
}
}
let query = {