From 275ff6b41e9b89d1f2f2f41bad22893f6555d527 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 28 Aug 2020 20:08:12 -0600 Subject: [PATCH] Wire up the invite button --- src/RoomInvite.js | 3 ++- src/components/structures/UserMenu.tsx | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/RoomInvite.js b/src/RoomInvite.js index 7f2eec32f3..ed3fe1452e 100644 --- a/src/RoomInvite.js +++ b/src/RoomInvite.js @@ -25,6 +25,7 @@ import { _t } from './languageHandler'; import {KIND_DM, KIND_INVITE} from "./components/views/dialogs/InviteDialog"; import CommunityPrototypeInviteDialog from "./components/views/dialogs/CommunityPrototypeInviteDialog"; import GroupStore from "./stores/GroupStore"; +import {CommunityPrototypeStore} from "./stores/CommunityPrototypeStore"; /** * Invites multiple addresses to a room @@ -76,7 +77,7 @@ export function showCommunityInviteDialog(communityId) { }); if (!chat) chat = rooms[0]; if (chat) { - const name = CommunityPrototypeInviteDialog.instance.getCommunityName(communityId); + const name = CommunityPrototypeStore.instance.getCommunityName(communityId); showCommunityRoomInviteDialog(chat.roomId, name); } else { throw new Error("Failed to locate appropriate room to start an invite in"); diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 476fe19ad7..8e62402141 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -45,6 +45,7 @@ import IconizedContextMenu, { import { CommunityPrototypeStore } from "../../stores/CommunityPrototypeStore"; import * as fbEmitter from "fbemitter"; import TagOrderStore from "../../stores/TagOrderStore"; +import { showCommunityInviteDialog } from "../../RoomInvite"; interface IProps { isMinimized: boolean; @@ -217,7 +218,8 @@ export default class UserMenu extends React.Component { ev.preventDefault(); ev.stopPropagation(); - console.log("TODO@onCommunityInviteClick"); + showCommunityInviteDialog(TagOrderStore.getSelectedPrototypeTag()); + this.setState({contextMenuPosition: null}); // also close the menu }; private renderContextMenu = (): React.ReactNode => {