3
0
mirror of https://github.com/Qortal/q-mail.git synced 2025-02-11 17:55:56 +00:00

Merge pull request #1 from QuickMythril/threads-avatar

Add avatar images to threads posts
This commit is contained in:
Qortal Dev 2024-02-21 13:05:41 -07:00 committed by GitHub
commit 604e5ee096
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,22 @@ export const GroupMail = ({ groupInfo, setCurrentThread, currentThread, filterMo
const dispatch = useDispatch();
const navigate = useNavigate();
const getAvatar = async (user: string) => {
try {
let url = await qortalRequest({
action: 'GET_QDN_RESOURCE_URL',
name: user,
service: 'THUMBNAIL',
identifier: 'qortal_avatar'
})
dispatch(
setUserAvatarHash({
name: user,
url
})
)
} catch (error) {}
}
const getAllThreads = React.useCallback(
async (groupId: string, mode: string, isInitial?: boolean) => {
@ -271,7 +286,7 @@ export const GroupMail = ({ groupInfo, setCurrentThread, currentThread, filterMo
}
}
await getAvatar(thread?.name);
}
} catch (error) {
console.log(error)