Skip to content

Commit

Permalink
Keep Matrix chat persistent
Browse files Browse the repository at this point in the history
When a user closes the Matrix chat, the iframe is closed and the session
is killed, adding a loading delay every time. To avoid this, just hide
the iframe instead of closing it.
  • Loading branch information
andrealmeid committed Oct 26, 2023
1 parent f331d4d commit f25b27a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const Matrix = ({
intl,
layoutContextDispatch,
isResizing,
isVisible,
}) => {
const { isChrome } = browserInfo;

Expand All @@ -52,7 +53,11 @@ const Matrix = ({
const matrixurl = `/riot-embedded/index.html?urlroomid=${matrixRoomID}&urlemail=${urlemail}&urlregcode=${urlregcode}`;

return (
<Styled.Matrix data-test="matrix" isChrome={isChrome}>
<Styled.Matrix
data-test="matrix"
isChrome={isChrome}
style={{ visibility: isVisible ? 'visible' : 'hidden', }}
>
<Header
leftButtonProps={{
onClick: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const SidebarContent = (props) => {
isToSharedNotesBeShow={sidebarContentPanel === PANELS.SHARED_NOTES}
/>
)}
{sidebarContentPanel === PANELS.MATRIX && <MatrixContainer />}
<MatrixContainer isVisible={sidebarContentPanel === PANELS.MATRIX}/>
{sidebarContentPanel === PANELS.SHARED_NOTES && <NotesContainer />}
{sidebarContentPanel === PANELS.CAPTIONS && <CaptionsContainer />}
{sidebarContentPanel === PANELS.BREAKOUT && <BreakoutRoomContainer />}
Expand Down

0 comments on commit f25b27a

Please sign in to comment.