Use hooks better (from develop)
This commit is contained in:
parent
cd360ba92f
commit
652c037380
1 changed files with 3 additions and 8 deletions
|
@ -40,7 +40,7 @@ import TextWithTooltip from "../elements/TextWithTooltip";
|
||||||
import BaseAvatar from "../avatars/BaseAvatar";
|
import BaseAvatar from "../avatars/BaseAvatar";
|
||||||
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
|
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";
|
||||||
import WidgetStore, {IApp} from "../../../stores/WidgetStore";
|
import WidgetStore, {IApp} from "../../../stores/WidgetStore";
|
||||||
import { shieldStatusForRoom } from "../../../utils/ShieldUtils";
|
import RoomContext from "../../../contexts/RoomContext";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
room: Room;
|
room: Room;
|
||||||
|
@ -200,13 +200,8 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, onClose }) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const isRoomEncrypted = useIsEncrypted(cli, room);
|
const isRoomEncrypted = useIsEncrypted(cli, room);
|
||||||
|
const roomContext = useContext(RoomContext);
|
||||||
const [e2eStatus, setE2eStatus] = useState<string>();
|
const e2eStatus = roomContext['e2eStatus'];
|
||||||
useEffect(() => {
|
|
||||||
if (isRoomEncrypted) {
|
|
||||||
shieldStatusForRoom(cli, room).then(e => setE2eStatus(e));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || "";
|
const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || "";
|
||||||
const header = <React.Fragment>
|
const header = <React.Fragment>
|
||||||
|
|
Loading…
Reference in a new issue