Run all selected prototype community logic through one store
This commit is contained in:
parent
93d67a6689
commit
724e3f6905
8 changed files with 31 additions and 30 deletions
|
@ -47,8 +47,22 @@ export class CommunityPrototypeStore extends AsyncStoreWithClient<IState> {
|
|||
return CommunityPrototypeStore.internalInstance;
|
||||
}
|
||||
|
||||
public getSelectedCommunityId(): string {
|
||||
if (SettingsStore.getValue("feature_communities_v2_prototypes")) {
|
||||
return TagOrderStore.getSelectedTags()[0];
|
||||
}
|
||||
return null; // no selection as far as this function is concerned
|
||||
}
|
||||
|
||||
public getSelectedCommunityName(): string {
|
||||
return CommunityPrototypeStore.instance.getCommunityName(TagOrderStore.getSelectedPrototypeTag());
|
||||
return CommunityPrototypeStore.instance.getCommunityName(this.getSelectedCommunityId());
|
||||
}
|
||||
|
||||
public getSelectedCommunityGeneralChat(): Room {
|
||||
const communityId = this.getSelectedCommunityId();
|
||||
if (communityId) {
|
||||
return this.getGeneralChat(communityId);
|
||||
}
|
||||
}
|
||||
|
||||
public getCommunityName(communityId: string): string {
|
||||
|
|
|
@ -286,13 +286,6 @@ class TagOrderStore extends Store {
|
|||
getSelectedTags() {
|
||||
return this._state.selectedTags;
|
||||
}
|
||||
|
||||
getSelectedPrototypeTag() {
|
||||
if (SettingsStore.getValue("feature_communities_v2_prototypes")) {
|
||||
return this.getSelectedTags()[0];
|
||||
}
|
||||
return null; // no selection as far as this function is concerned
|
||||
}
|
||||
}
|
||||
|
||||
if (global.singletonTagOrderStore === undefined) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue