Skip to content

Commit

Permalink
Merge pull request #40 from newfold-labs/fix/nonclose
Browse files Browse the repository at this point in the history
fix help center not closing on bh page refresh
  • Loading branch information
circlecube authored Jan 17, 2024
2 parents 43a6142 + 1ae4b50 commit a41e012
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '14909b5dc8e12284ee9c');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'f1170ffb253c0cd14f3f');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import { Analytics, LocalStorageUtils, OnboardingAPIs } from './utils';
import '../styles.scss';

const OpenHelpCenterForNovice = async () => {
const queryParams = new URL( document.location ).searchParams;
const url = new URL( document.location );
const queryParams = url.searchParams;
const referrer = queryParams.get( 'referrer' );
if ( ! referrer ) {
return;
Expand All @@ -20,7 +21,9 @@ const OpenHelpCenterForNovice = async () => {
// Check for the user's wordpress capability
const flowData = await OnboardingAPIs.getFlowData();
if ( flowData.data.wpComfortLevel === '1' ) {
url.searchParams.delete( 'referrer' );
toggleHelp( true );
window.history.replaceState( {}, document.title, url.href );
}
}
};
Expand Down

0 comments on commit a41e012

Please sign in to comment.