mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-05 03:51:26 +01:00
test: fix redis, from was string in map, but int in notif object
This commit is contained in:
@@ -106,7 +106,7 @@ Notifications.getMultiple = async function (nids) {
|
|||||||
return userData;
|
return userData;
|
||||||
});
|
});
|
||||||
// from can be either uid or cid
|
// from can be either uid or cid
|
||||||
const userMap = new Map(userKeys.map((from, index) => [from, usersData[index]]));
|
const userMap = new Map(userKeys.map((from, index) => [String(from), usersData[index]]));
|
||||||
|
|
||||||
notifications.forEach((notification) => {
|
notifications.forEach((notification) => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
@@ -125,8 +125,9 @@ Notifications.getMultiple = async function (nids) {
|
|||||||
if (notification.bodyLong) {
|
if (notification.bodyLong) {
|
||||||
notification.bodyLong = utils.stripHTMLTags(notification.bodyLong, ['img', 'p', 'a']);
|
notification.bodyLong = utils.stripHTMLTags(notification.bodyLong, ['img', 'p', 'a']);
|
||||||
}
|
}
|
||||||
if (userMap.has(notification.from)) {
|
const fromUser = userMap.get(String(notification.from));
|
||||||
notification.user = userMap.get(notification.from);
|
if (fromUser !== undefined) {
|
||||||
|
notification.user = fromUser;
|
||||||
}
|
}
|
||||||
if (notification.user && notification.from) {
|
if (notification.user && notification.from) {
|
||||||
notification.image = notification.user.picture || null;
|
notification.image = notification.user.picture || null;
|
||||||
|
|||||||
Reference in New Issue
Block a user