mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-15 02:07:50 -05:00
loading using an Async Thunk
This commit is contained in:
@@ -13,6 +13,7 @@ class ListCalls extends React.Component {
|
||||
//https://stackoverflow.com/questions/36559661/how-can-i-dispatch-from-child-components-in-react-redux
|
||||
//https://stackoverflow.com/questions/42597602/react-onclick-pass-event-with-parameter
|
||||
render() {
|
||||
const callsData = this.props.callsData;
|
||||
return (
|
||||
|
||||
<Table id="calls" unstackable >
|
||||
@@ -24,20 +25,24 @@ class ListCalls extends React.Component {
|
||||
<Table.HeaderCell><Icon name='star' /></Table.HeaderCell>
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body >
|
||||
{callsData != false &&
|
||||
<Table.Body>
|
||||
|
||||
{this.props.callsAllIds.map((callId, index) => {
|
||||
{
|
||||
this.props.callsData.ids.map((callId, index) => {
|
||||
if (callId === this.props.activeCallId) {
|
||||
return (<Ref innerRef={this.props.currentCallRef} key={index} ><CallItem activeCall={true} call={this.props.callsById[callId]} talkgroups={this.props.talkgroups} key={index} onClick={this.props.playCall}/></Ref>)
|
||||
return (<Ref innerRef={this.props.currentCallRef} key={index} ><CallItem activeCall={true} call={this.props.callsData.entities[callId]} talkgroups={this.props.talkgroups} key={index} onClick={this.props.playCall}/></Ref>)
|
||||
} else {
|
||||
return <CallItem activeCall={false} call={this.props.callsById[callId]} talkgroups={this.props.talkgroups} key={index} onClick={this.props.playCall}/>
|
||||
return <CallItem activeCall={false} call={this.props.callsData.entities[callId]} talkgroups={this.props.talkgroups} key={index} onClick={this.props.playCall}/>
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</Table.Body>
|
||||
}
|
||||
</Table>
|
||||
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user