Skip to content

Commit

Permalink
Fixe panel show on restart
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Oct 24, 2018
1 parent 7e57ba3 commit 97a1081
Showing 1 changed file with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,30 @@ export class RewardsPanel extends React.Component<Props, State> {
!prevProps.rewardsPanelData.walletCreated &&
this.props.rewardsPanelData.walletCreated
) {
chrome.tabs.query({
active: true,
currentWindow: true
}, (tabs) => {
if (!tabs || !tabs.length) {
return
}
this.props.actions.onTabRetrieved(tabs[0])
})
this.getTabData()
}
}

getTabData () {
chrome.tabs.query({
active: true,
currentWindow: true
}, (tabs) => {
if (!tabs || !tabs.length) {
return
}
this.props.actions.onTabRetrieved(tabs[0])
})
}

onWindowCallback = (window: chrome.windows.Window) => {
this.setState({
windowId: window.id
})

if (this.props.rewardsPanelData.walletCreated) {
this.getTabData()
}
}

openRewards () {
Expand Down

0 comments on commit 97a1081

Please sign in to comment.