Iterate PR
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
40954313e4
commit
046b3f325c
1 changed files with 10 additions and 9 deletions
|
@ -122,19 +122,20 @@ export default class RoomDirectory extends React.Component<IProps, IState> {
|
||||||
const myHomeserver = MatrixClientPeg.getHomeserverName();
|
const myHomeserver = MatrixClientPeg.getHomeserverName();
|
||||||
const lsRoomServer = localStorage.getItem(LAST_SERVER_KEY);
|
const lsRoomServer = localStorage.getItem(LAST_SERVER_KEY);
|
||||||
const lsInstanceId = localStorage.getItem(LAST_INSTANCE_KEY);
|
const lsInstanceId = localStorage.getItem(LAST_INSTANCE_KEY);
|
||||||
const roomServer = (
|
|
||||||
|
let roomServer = myHomeserver;
|
||||||
|
if (
|
||||||
SdkConfig.get().roomDirectory?.servers?.includes(lsRoomServer) ||
|
SdkConfig.get().roomDirectory?.servers?.includes(lsRoomServer) ||
|
||||||
SettingsStore.getValue("room_directory_servers")?.includes(lsRoomServer)
|
SettingsStore.getValue("room_directory_servers")?.includes(lsRoomServer)
|
||||||
) ? lsRoomServer : myHomeserver;
|
) {
|
||||||
|
roomServer = lsRoomServer;
|
||||||
|
}
|
||||||
|
|
||||||
let instanceId: string = null;
|
let instanceId: string = null;
|
||||||
if (
|
if (roomServer === myHomeserver && (
|
||||||
(lsInstanceId === ALL_ROOMS) ||
|
lsInstanceId === ALL_ROOMS ||
|
||||||
(
|
|
||||||
roomServer === myHomeserver &&
|
|
||||||
Object.values(this.protocols).some(p => p.instances.some(i => i.instance_id === lsInstanceId))
|
Object.values(this.protocols).some(p => p.instances.some(i => i.instance_id === lsInstanceId))
|
||||||
)
|
)) {
|
||||||
) {
|
|
||||||
instanceId = lsInstanceId;
|
instanceId = lsInstanceId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue