Skip to content

Commit

Permalink
don't shorten station name in audience
Browse files Browse the repository at this point in the history
  • Loading branch information
assaf committed Sep 16, 2017
1 parent 5e4b2b5 commit d256eae
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ export default class App extends React.Component {
});
}

formatStation() {
return this.urbit.formatStation(this.state.stationShip, this.state.stationChannel)
formatStation(short) {
return this.urbit.formatStation(this.state.stationShip, this.state.stationChannel, short)
}

render() {
Expand Down Expand Up @@ -286,7 +286,7 @@ export default class App extends React.Component {
return (
<View style={styles.container}>
<TouchableOpacity onPress={this.doLeave.bind(this)}>
<Header title={this.formatStation()} />
<Header title={this.formatStation(true)} />
</TouchableOpacity>

<FlatList
Expand Down Expand Up @@ -317,7 +317,7 @@ export default class App extends React.Component {
renderItem({item}) {
var avatarUrl = 'https://robohash.org/~.~'+item.sender

var sender = this.urbit.formatShip(item.sender)
var sender = this.urbit.formatShip(item.sender, true)
var time = new Date(item.ts).toLocaleString();

var messages = []
Expand Down
2 changes: 1 addition & 1 deletion JoinStation.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class JoinStation extends React.Component {
if (!res) {
this.setState({
submitted: false,
formError: "Failed to join " + this.urbitAnon.formatStation(this.state.stationShip, this.state.stationChannel),
formError: "Failed to join " + this.urbitAnon.formatStation(this.state.stationShip, this.state.stationChannel, true),
formStatusStyle: styles.formError
})

Expand Down
12 changes: 7 additions & 5 deletions Urbit.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,15 @@ export default class Urbit {
return str.slice(0, -1);
}

formatStation(stationShip, stationChannel) {
return "~" + this.formatShip(stationShip) + "/" + stationChannel
formatStation(stationShip, stationChannel, short) {
return "~" + this.formatShip(stationShip, short) + "/" + stationChannel
}

formatShip(ship) {
if (ship.length == 56) {
ship = ship.substring(0, 6) + "_" + ship.substring(50)
formatShip(ship, short) {
if (short) {
if (ship.length == 56) {
ship = ship.substring(0, 6) + "_" + ship.substring(50)
}
}
return ship
}
Expand Down

0 comments on commit d256eae

Please sign in to comment.