mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 20:52:23 +03:00
launch: subscribe to invite-view, pass invite data
This commit adds a new subscription to launch and retain the current tile data prop structure by initialising the data prop as an object and always appending the invite information to it.
This commit is contained in:
parent
a219014949
commit
95acca9acb
@ -17,9 +17,15 @@ export default class Home extends Component {
|
||||
render() {
|
||||
let keys = [...this.props.keys];
|
||||
let tileElems = keys.map((tile) => {
|
||||
return (
|
||||
<Tile key={tile} type={tile} data={this.props.data[tile]} />
|
||||
);
|
||||
let tileData = {};
|
||||
if (tile in this.props.data && tile !== "invite-initial") {
|
||||
tileData = this.props.data[tile] !== null
|
||||
? this.props.data[tile] : {};
|
||||
|
||||
tileData["invites"] = ("invite-initial" in this.props.data)
|
||||
? this.props.data["invite-initial"] : {};
|
||||
}
|
||||
return <Tile key={tile} type={tile} data={tileData} />;
|
||||
});
|
||||
|
||||
return (
|
||||
|
@ -26,7 +26,11 @@ export class Subscription {
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this),
|
||||
ship);
|
||||
}
|
||||
api.bind("invite-view", '/primary',
|
||||
this.handleEvent.bind(this),
|
||||
this.handleError.bind(this),
|
||||
ship);
|
||||
}
|
||||
|
||||
handleEvent(diff) {
|
||||
store.handleEvent(diff);
|
||||
|
Loading…
Reference in New Issue
Block a user