Skip to content

Commit

Permalink
DNN-36093: fixed portal alias update on website change
Browse files Browse the repository at this point in the history
  • Loading branch information
daguiler committed Apr 8, 2020
1 parent ea019e4 commit a1eb325
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,11 @@ class SiteAliasesPanel extends Component {

loadData() {
const {props} = this;
if (props.siteAliases) {
if (props.portalId === undefined || props.siteAliases.PortalId === props.portalId) {
return false;
}
else {
return true;
}
}
else {
return true;
}
props.dispatch(SiteBehaviorActions.getSiteAliases(props.portalId));
}

componentDidMount() {
const {props} = this;

if (!this.loadData()) {
return;
}
props.dispatch(SiteBehaviorActions.getSiteAliases(props.portalId));
this.loadData();
}

componentDidUpdate(prevProps) {
Expand All @@ -59,6 +44,11 @@ class SiteAliasesPanel extends Component {
tableFields.push({ "name": resx.get("Primary.Header"), "id": "Primary" });
}
this.setState({tableFields});

if (!props.siteAliases ||
props.portalId !== undefined && props.siteAliases.PortalId !== props.portalId) {
this.loadData();
}
}
}

Expand Down

0 comments on commit a1eb325

Please sign in to comment.