Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(8.5.4) GH-2186: Always open promo modal links in same window as panel #617

Merged
merged 2 commits into from Oct 26, 2020
Merged
Changes from all commits
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

@@ -63,7 +63,7 @@ class PromoModal extends React.Component {
* Handle clicks on the download buttons
*/
_handlePromoTryProductClick = (product, utm_campaign) => {
const { actions } = this.props;
const { actions, tab_id } = this.props;
actions.togglePromoModal();

let url;
@@ -84,6 +84,7 @@ class PromoModal extends React.Component {
sendMessage('openNewTab', {
url,
become_active: true,
tab_id, // Make sure we open the tab in the window with the open extension panel, even if another window is active
});
}

@@ -199,6 +200,7 @@ PromoModal.propTypes = {
type: PropTypes.string.isRequired,
location: PropTypes.string,
isPlus: PropTypes.bool,
tab_id: PropTypes.number.isRequired,
};

PromoModal.defaultProps = {
@@ -11,6 +11,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0
*/

import { connect } from 'react-redux';
import PromoModalContainer from './PromoModalContainer';

export default PromoModalContainer;
const mapStateToProps = state => ({ tab_id: state.panel.tab_id });

export default connect(mapStateToProps, undefined)(PromoModalContainer);
ProTip! Use n and p to navigate between commits in a pull request.