Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Open local addresses section by default when there are no existing lo…
Browse files Browse the repository at this point in the history
…cal addresses

Signed-off-by: Aaron Raimist <aaron@raim.ist>
  • Loading branch information
aaronraimist committed Jun 12, 2021
1 parent 91a88f2 commit 5ae1b14
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/views/room_settings/AliasSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ export default class AliasSettings extends React.Component {
}
}
this.setState({ localAliases });

if (localAliases.length === 0) {
this.setState({ detailsOpen: true });
}
} finally {
this.setState({ localAliasesLoading: false });
}
Expand Down Expand Up @@ -388,7 +392,7 @@ export default class AliasSettings extends React.Component {
/>
<span className='mx_SettingsTab_subheading mx_AliasSettings_localAliasHeader'>{_t("Local Addresses")}</span>
<p>{_t("Set addresses for this room so users can find this room through your homeserver (%(localDomain)s)", {localDomain})}</p>
<details onToggle={this.onLocalAliasesToggled}>
<details onToggle={this.onLocalAliasesToggled} open={this.state.detailsOpen}>
<summary>{ this.state.detailsOpen ? _t('Show less') : _t("Show more")}</summary>
{localAliasesList}
</details>
Expand Down

0 comments on commit 5ae1b14

Please sign in to comment.