Skip to content

Commit

Permalink
remove duplicate componentDidMount (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
rithvikvibhu authored Jul 6, 2022
1 parent 758fff2 commit 534fb11
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 18 deletions.
5 changes: 1 addition & 4 deletions app/components/SendModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ class SendModal extends Component {
hip2.setServers([`127.0.0.1:${props.hip2Port}`]);
}

componentDidMount () {
analytics.screenView('Send');
}

openLinkHandler (e) {
e.preventDefault()
shell.openExternal(e.target.href)
Expand Down Expand Up @@ -170,6 +166,7 @@ class SendModal extends Component {

componentDidMount = () => {
document.addEventListener('keydown', this.handleEscape)
analytics.screenView('Send');
}

componentWillUnmount = () => {
Expand Down
2 changes: 0 additions & 2 deletions app/components/Transactions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ export default class Transactions extends Component {
this.setState({
itemsPerPage: itemsPerPage || 5,
});
}

async componentDidMount() {
await this.props.fetchTransactions();
}

Expand Down
3 changes: 0 additions & 3 deletions app/pages/Auction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ export default class Auction extends Component {
} finally {
this.setState({isLoading: false});
}
}

componentDidMount() {
analytics.screenView('Auction');
}

Expand Down
6 changes: 2 additions & 4 deletions app/pages/DomainManager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,15 @@ class DomainManager extends Component {
|| this.state.itemsPerPage !== nextState.itemsPerPage;
}

componentDidMount() {
analytics.screenView('Domain Manager');
}

async componentDidMount() {
this.props.getMyNames();
const itemsPerPage = await dbClient.get(DM_ITEMS_PER_PAGE_KEY);

this.setState({
itemsPerPage: itemsPerPage || 10,
});

analytics.screenView('Domain Manager');
}

onChange = (name) => (e) => {
Expand Down
3 changes: 0 additions & 3 deletions app/pages/MyDomain/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ class MyDomain extends Component {
async componentDidMount() {
await this.props.getNameInfo();
await this.props.fetchPendingTransactions();
}

componentDidMount() {
analytics.screenView('My Domains');
}

Expand Down
2 changes: 0 additions & 2 deletions app/pages/Watching/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ class Watching extends Component {
this.setState({
itemsPerPage: itemsPerPage || 10,
});
}

componentDidMount() {
analytics.screenView('Watching');
}

Expand Down

0 comments on commit 534fb11

Please sign in to comment.