diff --git a/src/ConferenceCallManagerHooks.jsx b/src/ConferenceCallManagerHooks.jsx
index 2e5d32d7..7a5a815f 100644
--- a/src/ConferenceCallManagerHooks.jsx
+++ b/src/ConferenceCallManagerHooks.jsx
@@ -724,13 +724,19 @@ export function useProfile(client) {
try {
await client.setDisplayName(displayName);
- const url = await client.uploadContent(avatar);
- await client.setAvatarUrl(url);
+ let mxcAvatarUrl;
+
+ if (avatar) {
+ mxcAvatarUrl = await client.uploadContent(avatar);
+ await client.setAvatarUrl(mxcAvatarUrl);
+ }
setState((prev) => ({
...prev,
displayName,
- avatarUrl: getAvatarUrl(client, url),
+ avatarUrl: mxcAvatarUrl
+ ? getAvatarUrl(client, mxcAvatarUrl)
+ : prev.avatarUrl,
loading: false,
success: true,
}));
diff --git a/src/ProfileModal.jsx b/src/ProfileModal.jsx
index 3e86e862..9dd15f9a 100644
--- a/src/ProfileModal.jsx
+++ b/src/ProfileModal.jsx
@@ -4,7 +4,13 @@ import { useProfile } from "./ConferenceCallManagerHooks";
import { FieldRow, InputField, ErrorMessage } from "./Input";
import { Modal, ModalContent } from "./Modal";
-export function ProfileModal({ client, ...rest }) {
+export function ProfileModal({
+ client,
+ isAuthenticated,
+ isPasswordlessUser,
+ isGuest,
+ ...rest
+}) {
const { onClose } = rest;
const {
success,
@@ -60,9 +66,16 @@ export function ProfileModal({ client, ...rest }) {
onChange={onChangeDisplayName}
/>
-
-
-
+ {isAuthenticated && !isGuest && !isPasswordlessUser && (
+
+
+
+ )}
{error && (
{error.message}
diff --git a/src/UserMenu.jsx b/src/UserMenu.jsx
index e40b89b7..0e6037d1 100644
--- a/src/UserMenu.jsx
+++ b/src/UserMenu.jsx
@@ -108,7 +108,15 @@ export function UserMenu({ disableLogout }) {
)}
- {modalState.isOpen && }
+ {modalState.isOpen && (
+
+ )}
>
);
}