1
0
mirror of https://github.com/hyperspacedev/hyperspace synced 2025-02-09 16:28:43 +01:00

Update About to work with admin name field for config

This commit is contained in:
Marquis Kurt 2019-04-08 15:47:41 -04:00
parent e79dd84545
commit 49e92c0d23
2 changed files with 5 additions and 3 deletions

View File

@ -11,8 +11,8 @@
"defaultInstance": "mastodon.social" "defaultInstance": "mastodon.social"
}, },
"admin": { "admin": {
"name": "Marquis Kurt", "name": "Hyperspace Developers",
"account": "367895" "account": "774314"
}, },
"license": { "license": {
"name": "Apache 2.0 License", "name": "Apache 2.0 License",

View File

@ -34,6 +34,7 @@ interface IAboutPageState {
federated?: boolean; federated?: boolean;
developer?: boolean; developer?: boolean;
hyperspaceAdmin?: UAccount; hyperspaceAdmin?: UAccount;
hyperspaceAdminName?: string;
versionNumber?: string; versionNumber?: string;
brandName?: string; brandName?: string;
license: License; license: License;
@ -69,6 +70,7 @@ class AboutPage extends Component<any, IAboutPageState> {
console.log(config); console.log(config);
this.setState({ this.setState({
hyperspaceAdmin: account, hyperspaceAdmin: account,
hyperspaceAdminName: config.admin.name,
federated: config.federated? config.federated === "true": false, federated: config.federated? config.federated === "true": false,
developer: config.developer? config.developer === "true": false, developer: config.developer? config.developer === "true": false,
versionNumber: config.version, versionNumber: config.version,
@ -141,7 +143,7 @@ class AboutPage extends Component<any, IAboutPageState> {
<PersonIcon/> <PersonIcon/>
</Avatar> </Avatar>
</ListItemAvatar> </ListItemAvatar>
<ListItemText primary="App provider" secondary={this.state.hyperspaceAdmin? (this.state.hyperspaceAdmin.display_name || "@" + this.state.hyperspaceAdmin.acct): "No provider set in config"}/> <ListItemText primary="App provider" secondary={this.state.hyperspaceAdmin && this.state.hyperspaceAdminName? (this.state.hyperspaceAdminName || this.state.hyperspaceAdmin.display_name || "@" + this.state.hyperspaceAdmin.acct): "No provider set in config"}/>
<ListItemSecondaryAction> <ListItemSecondaryAction>
<LinkableIconButton to={`/compose?visibility=${this.state.federated? "public": "private"}&acct=${this.state.hyperspaceAdmin? this.state.hyperspaceAdmin.acct: ""}`}> <LinkableIconButton to={`/compose?visibility=${this.state.federated? "public": "private"}&acct=${this.state.hyperspaceAdmin? this.state.hyperspaceAdmin.acct: ""}`}>
<ChatIcon/> <ChatIcon/>