Iterate PR

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-07-09 12:31:44 +02:00
parent 40954313e4
commit 046b3f325c
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -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 ||
( Object.values(this.protocols).some(p => p.instances.some(i => i.instance_id === lsInstanceId))
roomServer === myHomeserver && )) {
Object.values(this.protocols).some(p => p.instances.some(i => i.instance_id === lsInstanceId))
)
) {
instanceId = lsInstanceId; instanceId = lsInstanceId;
} }