Skip to content
Snippets Groups Projects
Commit 4c0f6a4a authored by Gregor Schulz's avatar Gregor Schulz
Browse files

fix check

parent 2285c865
No related branches found
No related tags found
No related merge requests found
import { getMatrixId, isUsernameAvailable, setAvatarUrl, setDisplayName } from '../helpers/matrixClient'
import {
isUsernameAvailable,
getMatrixId,
setAvatarUrl,
setDisplayName
} from '../helpers/matrixClient'
import { logPhase, logWarn } from '../logger'
import { UserNameUpdatedDataPayload } from '../types'
......@@ -9,7 +14,7 @@ export const userNameUpdatedHandler = async (
try {
await logPhase(messageId, 'userNameUpdateHandler.updateName for identity ' + user.identity + ' to ' + user.name + 'and avatar to ' + user.avatar, async () => {
if (user.identity) {
if (!isUsernameAvailable(user.identity)) {
if (!(await isUsernameAvailable(user.identity))) {
logWarn(messageId, `Could not update user profile for ${user.identity}, because the user was not found.`)
return
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment