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 styled from "styled-components";
|
||||||
|
|
||||||
import { useNarrow } from "../../contexts/narrowProvider";
|
import { useNarrow } from "../../contexts/narrowProvider";
|
||||||
|
@ -71,6 +71,13 @@ export function ChatBody({
|
||||||
setShowMembersList(!showMembersList);
|
setShowMembersList(!showMembersList);
|
||||||
}, [showMembersList]);
|
}, [showMembersList]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!narrow) {
|
||||||
|
setShowChannelsList(false);
|
||||||
|
setShowMembersList(false);
|
||||||
|
}
|
||||||
|
}, [narrow]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ChatBodyWrapper className={className}>
|
<ChatBodyWrapper className={className}>
|
||||||
<ChatTopbar
|
<ChatTopbar
|
||||||
|
|
Loading…
Reference in New Issue