Remove the usage of symbol
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
7d6342fa40
commit
1220ad37ce
2 changed files with 7 additions and 7 deletions
|
@ -61,7 +61,7 @@ interface IState {
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
protocolsLoading: boolean;
|
protocolsLoading: boolean;
|
||||||
error?: string;
|
error?: string;
|
||||||
instanceId: string | symbol;
|
instanceId: string;
|
||||||
roomServer: string;
|
roomServer: string;
|
||||||
filterString: string;
|
filterString: string;
|
||||||
selectedCommunityId?: string;
|
selectedCommunityId?: string;
|
||||||
|
|
|
@ -41,7 +41,8 @@ import QuestionDialog from "../dialogs/QuestionDialog";
|
||||||
import UIStore from "../../../stores/UIStore";
|
import UIStore from "../../../stores/UIStore";
|
||||||
import { compare } from "../../../utils/strings";
|
import { compare } from "../../../utils/strings";
|
||||||
|
|
||||||
export const ALL_ROOMS = Symbol("ALL_ROOMS");
|
// 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";
|
||||||
|
|
||||||
const SETTING_NAME = "room_directory_servers";
|
const SETTING_NAME = "room_directory_servers";
|
||||||
|
|
||||||
|
@ -94,8 +95,7 @@ export interface IInstance {
|
||||||
fields: object;
|
fields: object;
|
||||||
network_id: string;
|
network_id: string;
|
||||||
// XXX: this is undocumented but we rely on it.
|
// XXX: this is undocumented but we rely on it.
|
||||||
// we inject a fake entry with a symbolic instance_id.
|
instance_id: string;
|
||||||
instance_id: string | symbol;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IProtocol {
|
export interface IProtocol {
|
||||||
|
@ -112,8 +112,8 @@ export type Protocols = Record<string, IProtocol>;
|
||||||
interface IProps {
|
interface IProps {
|
||||||
protocols: Protocols;
|
protocols: Protocols;
|
||||||
selectedServerName: string;
|
selectedServerName: string;
|
||||||
selectedInstanceId: string | symbol;
|
selectedInstanceId: string;
|
||||||
onOptionChange(server: string, instanceId?: string | symbol): void;
|
onOptionChange(server: string, instanceId?: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This dropdown sources homeservers from three places:
|
// This dropdown sources homeservers from three places:
|
||||||
|
@ -171,7 +171,7 @@ const NetworkDropdown = ({ onOptionChange, protocols = {}, selectedServerName, s
|
||||||
|
|
||||||
const protocolsList = server === hsName ? Object.values(protocols) : [];
|
const protocolsList = server === hsName ? Object.values(protocols) : [];
|
||||||
if (protocolsList.length > 0) {
|
if (protocolsList.length > 0) {
|
||||||
// add a fake protocol with the ALL_ROOMS symbol
|
// add a fake protocol with the ALL_ROOMS
|
||||||
protocolsList.push({
|
protocolsList.push({
|
||||||
instances: [{
|
instances: [{
|
||||||
fields: [],
|
fields: [],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue