Fix channel transition from narrow (#73)

This commit is contained in:
Szymon Szlachtowicz 2021-10-15 13:23:27 +02:00 committed by GitHub
parent 6fa1eddbc7
commit 6bd351ed41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import React, { useCallback, useMemo, useState } from "react";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import styled from "styled-components";
import { useNarrow } from "../../contexts/narrowProvider";
@ -71,6 +71,13 @@ export function ChatBody({
setShowMembersList(!showMembersList);
}, [showMembersList]);
useEffect(() => {
if (!narrow) {
setShowChannelsList(false);
setShowMembersList(false);
}
}, [narrow]);
return (
<ChatBodyWrapper className={className}>
<ChatTopbar