Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayadav09 committed Oct 14, 2024
1 parent 3493da3 commit b527c0f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions includes/HelpCenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,27 +146,27 @@ public function register_assets() {

/* Remove values on log out */
$logout_listener_js = <<<JS
jQuery(document).ready(function ($) {
$('a[href*="wp-login.php?action=logout"]').on('click', function () {
localStorage.removeItem('helpResultContent');
localStorage.removeItem('searchInput');
localStorage.removeItem('helpVisible');
});
});
JS;
jQuery(document).ready(function ($) {
$('a[href*="wp-login.php?action=logout"]').on('click', function () {
localStorage.removeItem('helpResultContent');
localStorage.removeItem('searchInput');
localStorage.removeItem('helpVisible');
});
});
JS;

\wp_add_inline_script( self::$slug, $logout_listener_js );

/* Remove values when the user is logged out */
$session_expiration_js = <<<JS
jQuery(document).on('heartbeat-tick', function (event, data) {
if (data.hasOwnProperty('wp-auth-check') && data['wp-auth-check'] === false) {
localStorage.removeItem('helpResultContent');
localStorage.removeItem('searchInput');
localStorage.removeItem('helpVisible');
}
});
JS;
jQuery(document).on('heartbeat-tick', function (event, data) {
if (data.hasOwnProperty('wp-auth-check') && data['wp-auth-check'] === false) {
localStorage.removeItem('helpResultContent');
localStorage.removeItem('searchInput');
localStorage.removeItem('helpVisible');
}
});
JS;

\wp_add_inline_script( self::$slug, $session_expiration_js );

Expand Down

0 comments on commit b527c0f

Please sign in to comment.