Skip to content

Commit

Permalink
Get rid of unused function.
Browse files Browse the repository at this point in the history
  • Loading branch information
spsiddarthan committed Mar 4, 2024
1 parent ba8e2e9 commit 1d4d9b9
Showing 1 changed file with 2 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,18 @@
* not render anything.
*/

import { Notice } from '@wordpress/components';
import { compose } from '@wordpress/compose';
import { withDispatch, withSelect } from '@wordpress/data';
import { Component, Fragment } from '@wordpress/element';
import { Component } from '@wordpress/element';
import { SOCIAL_STORE_ID } from '../../social-store';

class PublicizeConnectionVerify extends Component {
componentDidMount() {
this.props.refreshConnections();
}

/**
* Opens up popup so user can refresh connection
*
* Displays pop up with to specified URL where user
* can refresh a specific connection.
*
* @param {object} event - Event instance for onClick.
*/
refreshConnectionClick = event => {
const { href, title } = event.target;
event.preventDefault();
// open a popup window
// when it is closed, kick off the tests again
const popupWin = window.open( href, title, '' );
const popupTimer = window.setInterval( () => {
if ( false !== popupWin.closed ) {
window.clearInterval( popupTimer );
this.props.refreshConnections();
}
}, 500 );
};

renderNonRefreshableConnections() {
const { failedConnections } = this.props;
const nonRefreshableConnections = failedConnections.filter(
connection => ! connection.can_refresh
);

if ( nonRefreshableConnections.length ) {
return nonRefreshableConnections.map( connection => (
<Notice className="jetpack-publicize-notice" isDismissible={ false } status="error">
<p>{ connection.test_message }</p>
</Notice>
) );
}

return null;
}

render() {
return <Fragment>{ this.renderNonRefreshableConnections() }</Fragment>;
return null;
}
}

Expand Down

0 comments on commit 1d4d9b9

Please sign in to comment.