mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 16:17:29 +00:00
Fix exception when updating cached profile picture
This commit is contained in:
parent
297c9a0c08
commit
a45142a02d
@ -173,11 +173,11 @@ function updateProfilePictureFromReel(userID) {
|
|||||||
const profilePicURL = result.reel.user.profile_pic_url
|
const profilePicURL = result.reel.user.profile_pic_url
|
||||||
if (!profilePicURL) throw constants.symbols.NOT_FOUND
|
if (!profilePicURL) throw constants.symbols.NOT_FOUND
|
||||||
db.prepare("UPDATE Users SET profile_pic_url = ? WHERE user_id = ?").run(profilePicURL, userID)
|
db.prepare("UPDATE Users SET profile_pic_url = ? WHERE user_id = ?").run(profilePicURL, userID)
|
||||||
for (const user of userRequestCache.cache.values()) {
|
for (const entry of userRequestCache.cache.values()) {
|
||||||
// yes, data.data is correct.
|
// yes, data.data is correct.
|
||||||
if (user.data.data.id === userID) {
|
if (entry.data && entry.data.data && entry.data.data.id === userID) {
|
||||||
user.data.data.profile_pic_url = profilePicURL
|
entry.data.data.profile_pic_url = profilePicURL
|
||||||
user.data.computeProxyProfilePic()
|
entry.data.computeProxyProfilePic()
|
||||||
break // stop checking entries from the cache since we won't find any more
|
break // stop checking entries from the cache since we won't find any more
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user