You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-12-08 17:48:33 +03:00
Stop spinner on space preview if the join fails
This commit is contained in:
@@ -78,6 +78,7 @@ import { CreateEventField, IGroupSummary } from "../views/dialogs/CreateSpaceFro
|
|||||||
import { useAsyncMemo } from "../../hooks/useAsyncMemo";
|
import { useAsyncMemo } from "../../hooks/useAsyncMemo";
|
||||||
import Spinner from "../views/elements/Spinner";
|
import Spinner from "../views/elements/Spinner";
|
||||||
import GroupAvatar from "../views/avatars/GroupAvatar";
|
import GroupAvatar from "../views/avatars/GroupAvatar";
|
||||||
|
import { useDispatcher } from "../../hooks/useDispatcher";
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
space: Room;
|
space: Room;
|
||||||
@@ -191,6 +192,11 @@ interface ISpacePreviewProps {
|
|||||||
const SpacePreview = ({ space, onJoinButtonClicked, onRejectButtonClicked }: ISpacePreviewProps) => {
|
const SpacePreview = ({ space, onJoinButtonClicked, onRejectButtonClicked }: ISpacePreviewProps) => {
|
||||||
const cli = useContext(MatrixClientContext);
|
const cli = useContext(MatrixClientContext);
|
||||||
const myMembership = useMyRoomMembership(space);
|
const myMembership = useMyRoomMembership(space);
|
||||||
|
useDispatcher(defaultDispatcher, payload => {
|
||||||
|
if (payload.action === Action.JoinRoomError && payload.roomId === space.roomId) {
|
||||||
|
setBusy(false); // stop the spinner, join failed
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user