Pass around MatrixClients instead of using MatrixClientPeg (#11000)
This commit is contained in:
parent
aa5a2e1363
commit
938aefc51c
28 changed files with 176 additions and 141 deletions
|
@ -625,7 +625,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
this.notifyNewScreen("forgot_password");
|
||||
break;
|
||||
case "start_chat":
|
||||
createRoom({
|
||||
createRoom(MatrixClientPeg.get(), {
|
||||
dmUserId: payload.user_id,
|
||||
});
|
||||
break;
|
||||
|
@ -1062,7 +1062,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
|
||||
const [shouldCreate, opts] = await modal.finished;
|
||||
if (shouldCreate) {
|
||||
createRoom(opts!);
|
||||
createRoom(MatrixClientPeg.get(), opts!);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1246,7 +1246,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
|
||||
const welcomeUserRooms = DMRoomMap.shared().getDMRoomsForUserId(welcomeUserId);
|
||||
if (welcomeUserRooms.length === 0) {
|
||||
const roomId = await createRoom({
|
||||
const roomId = await createRoom(MatrixClientPeg.get(), {
|
||||
dmUserId: snakedConfig.get("welcome_user_id"),
|
||||
// Only view the welcome user if we're NOT looking at a room
|
||||
andView: !this.state.currentRoomId,
|
||||
|
|
|
@ -181,7 +181,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
|
|||
}
|
||||
|
||||
debuglog("requesting more search results");
|
||||
const searchPromise = searchPagination(results);
|
||||
const searchPromise = searchPagination(client, results);
|
||||
return handleSearchResult(searchPromise);
|
||||
};
|
||||
|
||||
|
|
|
@ -1621,7 +1621,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
|
|||
const roomId = scope === SearchScope.Room ? this.getRoomId() : undefined;
|
||||
debuglog("sending search request");
|
||||
const abortController = new AbortController();
|
||||
const promise = eventSearch(term, roomId, abortController.signal);
|
||||
const promise = eventSearch(this.context.client!, term, roomId, abortController.signal);
|
||||
|
||||
this.setState({
|
||||
search: {
|
||||
|
|
|
@ -336,7 +336,7 @@ const SpaceSetupFirstRooms: React.FC<{
|
|||
const filteredRoomNames = roomNames.map((name) => name.trim()).filter(Boolean);
|
||||
const roomIds = await Promise.all(
|
||||
filteredRoomNames.map((name) => {
|
||||
return createRoom({
|
||||
return createRoom(space.client, {
|
||||
createOpts: {
|
||||
preset: isPublic ? Preset.PublicChat : Preset.PrivateChat,
|
||||
name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue