Remove `qs` dependency from `ProductTour`,

use native `URLSearchParams` instead.
This commit is contained in:
Tomek Wytrębowicz 2022-10-17 23:52:43 +02:00
parent 33aa7c58dc
commit 30a487d545
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,6 @@ import { useEffect, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { TourKit, TourKitTypes } from '@woocommerce/components';
import { recordEvent } from '@woocommerce/tracks';
import qs from 'qs';
/**
* Internal dependencies
@ -294,7 +293,9 @@ export const ProductTour = () => {
recordEvent( 'walkthrough_product_enable_button_click' );
} );
const query = qs.parse( window.location.search.slice( 1 ) );
const query = Object.fromEntries(
new URLSearchParams( window.location.search )
);
if ( query && query.tutorial === 'true' ) {
const intervalId = waitUntilElementTopNotChange(
tourConfig.steps[ 0 ].referenceElements?.desktop || '',