Skip to content

Commit

Permalink
Mobile view (dexlab-io#78)
Browse files Browse the repository at this point in the history
* The Tip component is called with the appropiate parameters from
  inside the mobile view, so that it renders correctly.
* The Watcher object is initiated as soon as the Tip component is
  loaded in case it has the active tab. This didn't happen before as
  the tab navigation allowed it to start after the component was loaded.
  • Loading branch information
Emilio Silva Schlenker committed Mar 14, 2019
1 parent ac3a08b commit 0f7fcf3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/pages/Dashboard/components/Tip.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class Tip extends Component {
store.fetch.pos().subscribe(async result => {
const posAddress = result.data.pos.address;
this.setState({ posAddress });
if(this.props.active) {
this.startWatcher();
}
});
}

Expand Down
5 changes: 4 additions & 1 deletion src/pages/Dashboard/mobile.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ export default function() {
</React.Fragment>
)}
{activeTab === 'recentPayments' && <RecentPayments />}
{activeTab === 'tip' && <Tip onClose={this.onCloseTip} />}
<Tip
active={activeTab === 'tip'}
onTipReceived={this.onTipReceived}
/>
</div>
) : (
<div>Pos address is empty</div>
Expand Down

0 comments on commit 0f7fcf3

Please sign in to comment.