Run all selected prototype community logic through one store

This commit is contained in:
Travis Ralston 2020-08-31 10:19:05 -06:00
parent 93d67a6689
commit 724e3f6905
8 changed files with 31 additions and 30 deletions

View file

@ -27,7 +27,6 @@ import rate_limited_func from "../../../ratelimitedfunc";
import {MatrixClientPeg} from "../../../MatrixClientPeg";
import * as sdk from "../../../index";
import CallHandler from "../../../CallHandler";
import TagOrderStore from "../../../stores/TagOrderStore";
import {CommunityPrototypeStore} from "../../../stores/CommunityPrototypeStore";
const INITIAL_LOAD_NUM_MEMBERS = 30;
@ -467,12 +466,9 @@ export default createReactClass({
}
let inviteButtonText = _t("Invite to this room");
const communityId = TagOrderStore.getSelectedPrototypeTag();
if (communityId) {
const chat = CommunityPrototypeStore.instance.getGeneralChat(communityId);
if (chat && chat.roomId === this.props.roomId) {
inviteButtonText = _t("Invite to this community");
}
const chat = CommunityPrototypeStore.instance.getSelectedCommunityGeneralChat();
if (chat && chat.roomId === this.props.roomId) {
inviteButtonText = _t("Invite to this community");
}
const AccessibleButton = sdk.getComponent("elements.AccessibleButton");