Extract view/join room logic to room helper (#8329)

This commit is contained in:
Germain 2022-04-21 10:56:02 +01:00 committed by GitHub
parent d5e911d876
commit 5d6143aaa7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 226 additions and 122 deletions

View file

@ -17,7 +17,6 @@ limitations under the License.
import React, { useEffect, useState } from "react";
import { MatrixError } from "matrix-js-sdk/src/http-api";
import { IProtocol } from "matrix-js-sdk/src/client";
import { MatrixClientPeg } from '../../../MatrixClientPeg';
import { instanceForInstanceId } from '../../../utils/DirectoryUtils';
@ -42,9 +41,7 @@ import UIStore from "../../../stores/UIStore";
import { compare } from "../../../utils/strings";
import { SnakedObject } from "../../../utils/SnakedObject";
import { IConfigOptions } from "../../../IConfigOptions";
// XXX: We would ideally use a symbol here but we can't since we save this value to localStorage
export const ALL_ROOMS = "ALL_ROOMS";
import { ALL_ROOMS, Protocols } from "../../../utils/DirectoryUtils";
const SETTING_NAME = "room_directory_servers";
@ -85,8 +82,6 @@ const validServer = withValidation<undefined, { error?: MatrixError }>({
],
});
export type Protocols = Record<string, IProtocol>;
interface IProps {
protocols: Protocols;
selectedServerName: string;