| @@ -54,12 +54,17 @@ | ||
| 54 | 54 | 'elementor-editor', |
| 55 | 55 | 'elementor-v2-ui', |
| 56 | 56 | 'elementor-v2-icons', |
| 57 | 57 | 'elementor-v2-query', |
| 58 | - 'elementor-v2-editor-app-bar', | |
| 59 | 58 | 'wp-i18n', |
| 60 | 59 | ]; |
| 61 | 60 | |
| 61 | + $is_editor_v2 = current_action() === 'elementor/editor/v2/scripts/enqueue'; | |
| 62 | + | |
| 63 | + if ( $is_editor_v2 ) { | |
| 64 | + $deps[] = 'elementor-v2-editor-app-bar'; | |
| 65 | + } | |
| 66 | + | |
| 62 | 67 | wp_enqueue_script( |
| 63 | 68 | 'e-editor-notifications', |
| 64 | 69 | $this->get_js_assets_url( 'editor-notifications' ), |
| 65 | 70 | $deps, |
| @@ -75,9 +80,9 @@ | ||
| 75 | 80 | |
| 76 | 81 | wp_set_script_translations( 'e-editor-notifications', 'elementor' ); |
| 77 | 82 | } |
| 78 | 83 | |
| 79 | - private function get_app_js_config(): array { | |
| 84 | + private function get_app_js_config() : array { | |
| 80 | 85 | return [ |
| 81 | 86 | 'is_unread' => Options::has_unread_notifications(), |
| 82 | 87 | ]; |
| 83 | 88 | } |