@@ -28,7 +28,7 @@ import { _t } from "../../../languageHandler";
28
28
import MatrixClientContext from "../../../contexts/MatrixClientContext" ;
29
29
import { ButtonEvent } from "../elements/AccessibleButton" ;
30
30
import { DefaultTagID , TagID } from "../../../stores/room-list/models" ;
31
- import RoomListStore from "../../../stores/room-list/RoomListStore" ;
31
+ import RoomListStore , { LISTS_UPDATE_EVENT } from "../../../stores/room-list/RoomListStore" ;
32
32
import dis from "../../../dispatcher/dispatcher" ;
33
33
import RoomListActions from "../../../actions/RoomListActions" ;
34
34
import { Key } from "../../../Keyboard" ;
@@ -43,14 +43,19 @@ import { SetRightPanelPhasePayload } from "../../../dispatcher/payloads/SetRight
43
43
import { Action } from "../../../dispatcher/actions" ;
44
44
import { RightPanelPhases } from "../../../stores/RightPanelStorePhases" ;
45
45
import { ROOM_NOTIFICATIONS_TAB } from "../dialogs/RoomSettingsDialog" ;
46
+ import { useEventEmitterState } from "../../../hooks/useEventEmitter" ;
46
47
47
48
interface IProps extends IContextMenuProps {
48
49
room : Room ;
49
50
}
50
51
51
52
const RoomContextMenu = ( { room, onFinished, ...props } : IProps ) => {
52
53
const cli = useContext ( MatrixClientContext ) ;
53
- const roomTags = RoomListStore . instance . getTagsForRoom ( room ) ;
54
+ const roomTags = useEventEmitterState (
55
+ RoomListStore . instance ,
56
+ LISTS_UPDATE_EVENT ,
57
+ ( ) => RoomListStore . instance . getTagsForRoom ( room ) ,
58
+ ) ;
54
59
55
60
let leaveOption : JSX . Element ;
56
61
if ( roomTags . includes ( DefaultTagID . Archived ) ) {
0 commit comments