Check if element exists

This commit is contained in:
Narek Zakarian 2025-08-19 14:39:05 +04:00
parent e3549abd8d
commit 4e949b0733
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7

View file

@ -40,11 +40,13 @@ document.addEventListener( 'DOMContentLoaded', () => {
document.addEventListener( 'click', ( event ) => {
if (
event.target.closest( '.button.button-settings-switch-ui' ) ||
event.target.closest( '.ppcp-notice-wrapper:not(.inline) a.settings-switch-ui' ) ||
event.target.closest(
'.ppcp-notice-wrapper:not(.inline) a.settings-switch-ui'
) ||
event.target.closest( 'a[name="settings-switch-ui"]' ) ||
event.target
.closest( '.woocommerce-inbox-note__action-button' )
.textContent.includes( 'Switch to New Settings' )
?.textContent.includes( 'Switch to New Settings' )
) {
handleClick( event );
}