Fix channel transition from narrow (#73)
This commit is contained in:
parent
6fa1eddbc7
commit
6bd351ed41
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue