2022-05-26 20:56:22 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { recordEvent } from '@woocommerce/tracks';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2022-12-12 13:56:28 +00:00
|
|
|
import { addExitPageListener, initProductScreenTracks } from './shared';
|
2022-05-26 20:56:22 +00:00
|
|
|
|
|
|
|
const initTracks = () => {
|
|
|
|
recordEvent( 'product_edit_view' );
|
|
|
|
initProductScreenTracks();
|
|
|
|
};
|
|
|
|
|
2022-05-30 13:06:34 +00:00
|
|
|
if ( productScreen && productScreen.name === 'edit' ) {
|
2022-05-26 20:56:22 +00:00
|
|
|
initTracks();
|
2022-12-12 13:56:28 +00:00
|
|
|
|
|
|
|
addExitPageListener( 'product_edit_view' );
|
2022-05-26 20:56:22 +00:00
|
|
|
}
|