mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-10 09:10:29 +03:00
Fix dialog closing animation jank
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
1df4d32d69
commit
ba64ba0bd0
3 changed files with 20 additions and 12 deletions
|
|
@ -253,11 +253,10 @@ function ProfileViewer() {
|
|||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (isOpen) return;
|
||||
const handleAfterClose = () => {
|
||||
setUserId(null);
|
||||
setRoomId(null);
|
||||
}, [isOpen]);
|
||||
};
|
||||
|
||||
function renderProfile() {
|
||||
const member = room.getMember(userId) || mx.getUser(userId) || {};
|
||||
|
|
@ -298,10 +297,11 @@ function ProfileViewer() {
|
|||
className="profile-viewer__dialog"
|
||||
isOpen={isOpen}
|
||||
title={`${username} in ${room?.name ?? ''}`}
|
||||
onAfterClose={handleAfterClose}
|
||||
onRequestClose={() => setIsOpen(false)}
|
||||
contentOptions={<IconButton src={CrossIC} onClick={() => setIsOpen(false)} tooltip="Close" />}
|
||||
>
|
||||
{isOpen && renderProfile()}
|
||||
{roomId ? renderProfile() : <div />}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue