remove extra parentheses showing account numbers (#726)

This commit is contained in:
zc 2022-04-30 15:20:08 +08:00 committed by GitHub
parent c05fb77224
commit 8e48bddf5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,14 @@ class SelfLoginButton extends React.Component {
};
}
getAccountShowName() {
let {name, displayName} = this.props.account;
if (displayName !== '') {
name += ' (' + displayName + ')';
}
return name;
}
render() {
const config = {
icon: this.generateIcon(),
@ -32,7 +40,7 @@ class SelfLoginButton extends React.Component {
};
const SelfLoginButton = createButton(config);
return <SelfLoginButton text={`${this.props.account.name} (${this.props.account.displayName})`} onClick={() => this.props.onClick()} align={"center"} />
return <SelfLoginButton text={this.getAccountShowName()} onClick={() => this.props.onClick()} align={"center"}/>
}
}