mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 06:55:46 +01:00
perf: call getIconbackgrounds once
instead of 20x on topic/topic list load
This commit is contained in:
@@ -656,7 +656,7 @@ usersAPI.changePicture = async (caller, data) => {
|
||||
picture = returnData && returnData.picture;
|
||||
}
|
||||
|
||||
const validBackgrounds = await user.getIconBackgrounds(caller.uid);
|
||||
const validBackgrounds = await user.getIconBackgrounds();
|
||||
if (!validBackgrounds.includes(data.bgColor)) {
|
||||
data.bgColor = validBackgrounds[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user