Rename RoomListStore2 class name

We use `RoomListStore` as a singleton, and don't want the ugly `2` at the end of the actual store instance, so here we rename it to something half-decent.
This commit is contained in:
Travis Ralston 2020-07-17 15:10:30 -06:00
parent 1f9c07861e
commit 209a5d2220
4 changed files with 15 additions and 12 deletions

View file

@ -44,7 +44,7 @@ interface IState {
*/
export const LISTS_UPDATE_EVENT = "lists_update";
export class RoomListStore2 extends AsyncStoreWithClient<ActionPayload> {
export class RoomListStoreClass extends AsyncStoreWithClient<ActionPayload> {
/**
* Set to true if you're running tests on the store. Should not be touched in
* any other environment.
@ -175,7 +175,7 @@ export class RoomListStore2 extends AsyncStoreWithClient<ActionPayload> {
protected async onAction(payload: ActionPayload) {
// When we're running tests we can't reliably use setImmediate out of timing concerns.
// As such, we use a more synchronous model.
if (RoomListStore2.TEST_MODE) {
if (RoomListStoreClass.TEST_MODE) {
await this.onDispatchAsync(payload);
return;
}
@ -608,15 +608,15 @@ export class RoomListStore2 extends AsyncStoreWithClient<ActionPayload> {
}
export default class RoomListStore {
private static internalInstance: RoomListStore2;
private static internalInstance: RoomListStoreClass;
public static get instance(): RoomListStore2 {
public static get instance(): RoomListStoreClass {
if (!RoomListStore.internalInstance) {
RoomListStore.internalInstance = new RoomListStore2();
RoomListStore.internalInstance = new RoomListStoreClass();
}
return RoomListStore.internalInstance;
}
}
window.mx_RoomListStore2 = RoomListStore.instance;
window.mx_RoomListStore = RoomListStore.instance;

View file

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
import { RoomListStore2 } from "./RoomListStore2";
import { RoomListStoreClass } from "./RoomListStore2";
import TagOrderStore from "../TagOrderStore";
import { CommunityFilterCondition } from "./filters/CommunityFilterCondition";
import { arrayDiff, arrayHasDiff } from "../../utils/arrays";
@ -26,7 +26,7 @@ export class TagWatcher {
// TODO: Support custom tags, somehow: https://github.com/vector-im/riot-web/issues/14091
private filters = new Map<string, CommunityFilterCondition>();
constructor(private store: RoomListStore2) {
constructor(private store: RoomListStoreClass) {
TagOrderStore.addListener(this.onTagsUpdated);
}