Extract view/join room logic to room helper (#8329)
This commit is contained in:
parent
d5e911d876
commit
5d6143aaa7
6 changed files with 226 additions and 122 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue