Use more variables

pull/2379/head
David Baker 2016-09-30 09:39:30 +01:00
parent 761600f325
commit b71b1b5535
1 changed files with 5 additions and 4 deletions

View File

@ -64,11 +64,12 @@ module.exports = React.createClass({
this.nativePatterns = {};
if (this.props.config.networks) {
for (const network of Object.keys(this.props.config.networks)) {
if (this.props.config.networks[network].portalRoomPattern) {
this.portalRoomPatterns[network] = new RegExp(this.props.config.networks[network].portalRoomPattern);
const network_info = this.props.config.networks[network];
if (network_info.portalRoomPattern) {
this.portalRoomPatterns[network] = new RegExp(network_info.portalRoomPattern);
}
if (this.props.config.networks[network].nativePattern) {
this.nativePatterns[network] = new RegExp(this.props.config.networks[network].nativePattern);
if (network_info.nativePattern) {
this.nativePatterns[network] = new RegExp(network_info.nativePattern);
}
}
}