diff --git a/src/@types/global.d.ts b/src/@types/global.d.ts index 9424cdcd17..2d446e444a 100644 --- a/src/@types/global.d.ts +++ b/src/@types/global.d.ts @@ -20,7 +20,7 @@ import { IMatrixClientPeg } from "../MatrixClientPeg"; import ToastStore from "../stores/ToastStore"; import DeviceListener from "../DeviceListener"; import RebrandListener from "../RebrandListener"; -import { RoomListStore2 } from "../stores/room-list/RoomListStore2"; +import { RoomListStoreClass } from "../stores/room-list/RoomListStore2"; import { PlatformPeg } from "../PlatformPeg"; import RoomListLayoutStore from "../stores/room-list/RoomListLayoutStore"; import {IntegrationManagers} from "../integrations/IntegrationManagers"; @@ -37,7 +37,7 @@ declare global { mx_ToastStore: ToastStore; mx_DeviceListener: DeviceListener; mx_RebrandListener: RebrandListener; - mx_RoomListStore2: RoomListStore2; + mx_RoomListStore: RoomListStoreClass; mx_RoomListLayoutStore: RoomListLayoutStore; mxPlatformPeg: PlatformPeg; mxIntegrationManagers: typeof IntegrationManagers; diff --git a/src/stores/room-list/RoomListStore2.ts b/src/stores/room-list/RoomListStore2.ts index 9576ae8ed6..62e515c5b3 100644 --- a/src/stores/room-list/RoomListStore2.ts +++ b/src/stores/room-list/RoomListStore2.ts @@ -44,7 +44,7 @@ interface IState { */ export const LISTS_UPDATE_EVENT = "lists_update"; -export class RoomListStore2 extends AsyncStoreWithClient { +export class RoomListStoreClass extends AsyncStoreWithClient { /** * 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 { 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 { } 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; diff --git a/src/stores/room-list/TagWatcher.ts b/src/stores/room-list/TagWatcher.ts index 56b6437524..6f011271d5 100644 --- a/src/stores/room-list/TagWatcher.ts +++ b/src/stores/room-list/TagWatcher.ts @@ -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(); - constructor(private store: RoomListStore2) { + constructor(private store: RoomListStoreClass) { TagOrderStore.addListener(this.onTagsUpdated); } diff --git a/test/components/views/rooms/RoomList-test.js b/test/components/views/rooms/RoomList-test.js index e84f943708..43aa3dc2f8 100644 --- a/test/components/views/rooms/RoomList-test.js +++ b/test/components/views/rooms/RoomList-test.js @@ -14,7 +14,10 @@ import GroupStore from '../../../../src/stores/GroupStore.js'; import { MatrixClient, Room, RoomMember } from 'matrix-js-sdk'; import {DefaultTagID} from "../../../../src/stores/room-list/models"; -import RoomListStore, {LISTS_UPDATE_EVENT, RoomListStore2} from "../../../../src/stores/room-list/RoomListStore2"; +import RoomListStore, { + LISTS_UPDATE_EVENT, + RoomListStoreClass +} from "../../../../src/stores/room-list/RoomListStore2"; import RoomListLayoutStore from "../../../../src/stores/room-list/RoomListLayoutStore"; function generateRoomId() { @@ -49,7 +52,7 @@ describe('RoomList', () => { let myOtherMember; beforeEach(async function(done) { - RoomListStore2.TEST_MODE = true; + RoomListStoreClass.TEST_MODE = true; TestUtils.stubClient(); client = MatrixClientPeg.get();