Step 8.3: Convert RoomViewStore
to a more modern singleton for imports
This commit is contained in:
parent
8d2dba4102
commit
d5ed1eb66e
24 changed files with 99 additions and 102 deletions
|
@ -24,7 +24,7 @@ import { _t } from "../languageHandler";
|
|||
import Modal, { IHandle } from "../Modal";
|
||||
import ErrorDialog from "../components/views/dialogs/ErrorDialog";
|
||||
import dis from "../dispatcher/dispatcher";
|
||||
import RoomViewStore from "../stores/RoomViewStore";
|
||||
import { RoomViewStore } from "../stores/RoomViewStore";
|
||||
import Spinner from "../components/views/elements/Spinner";
|
||||
import { isMetaSpace } from "../stores/spaces";
|
||||
import SpaceStore from "../stores/spaces/SpaceStore";
|
||||
|
@ -186,7 +186,7 @@ export async function leaveRoomBehaviour(roomId: string, retry = true, spinner =
|
|||
|
||||
if (!isMetaSpace(SpaceStore.instance.activeSpace) &&
|
||||
SpaceStore.instance.activeSpace !== roomId &&
|
||||
RoomViewStore.getRoomId() === roomId
|
||||
RoomViewStore.instance.getRoomId() === roomId
|
||||
) {
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
|
|
|
@ -33,7 +33,7 @@ import CreateSubspaceDialog from "../components/views/dialogs/CreateSubspaceDial
|
|||
import AddExistingSubspaceDialog from "../components/views/dialogs/AddExistingSubspaceDialog";
|
||||
import defaultDispatcher from "../dispatcher/dispatcher";
|
||||
import dis from "../dispatcher/dispatcher";
|
||||
import RoomViewStore from "../stores/RoomViewStore";
|
||||
import { RoomViewStore } from "../stores/RoomViewStore";
|
||||
import { Action } from "../dispatcher/actions";
|
||||
import { leaveRoomBehaviour } from "./membership";
|
||||
import Spinner from "../components/views/elements/Spinner";
|
||||
|
@ -83,7 +83,7 @@ export const showAddExistingRooms = (space: Room): void => {
|
|||
onAddSubspaceClick: () => showAddExistingSubspace(space),
|
||||
space,
|
||||
onFinished: (added: boolean) => {
|
||||
if (added && RoomViewStore.getRoomId() === space.roomId) {
|
||||
if (added && RoomViewStore.instance.getRoomId() === space.roomId) {
|
||||
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
|
||||
}
|
||||
},
|
||||
|
@ -142,7 +142,7 @@ export const showAddExistingSubspace = (space: Room): void => {
|
|||
space,
|
||||
onCreateSubspaceClick: () => showCreateNewSubspace(space),
|
||||
onFinished: (added: boolean) => {
|
||||
if (added && RoomViewStore.getRoomId() === space.roomId) {
|
||||
if (added && RoomViewStore.instance.getRoomId() === space.roomId) {
|
||||
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
|
||||
}
|
||||
},
|
||||
|
@ -160,7 +160,7 @@ export const showCreateNewSubspace = (space: Room): void => {
|
|||
space,
|
||||
onAddExistingSpaceClick: () => showAddExistingSubspace(space),
|
||||
onFinished: (added: boolean) => {
|
||||
if (added && RoomViewStore.getRoomId() === space.roomId) {
|
||||
if (added && RoomViewStore.instance.getRoomId() === space.roomId) {
|
||||
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue