Check if group exist before fetching the mention (#6816)

This commit is contained in:
Daniel Espino García 2022-12-02 14:15:23 +01:00 committed by GitHub
parent 529d149a17
commit 33b2cb6623
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -451,7 +451,7 @@ export const fetchUsersByUsernames = async (serverUrl: string, usernames: string
const users = await client.getProfilesByUsernames([...new Set(usersToLoad)]);
if (!fetchOnly) {
if (users.length && !fetchOnly) {
await operator.handleUsers({
users,
prepareRecordsOnly: false,

View file

@ -142,7 +142,7 @@ const AtMention = ({
// Effects
useEffect(() => {
// Fetches and updates the local db store with the mention
if (!user.username) {
if (!user.username && !group?.name) {
fetchUserOrGroupsByMentionsInBatch(serverUrl, mentionName);
}
}, []);