File "utils.ts"

Full Path: /home/warrior1/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/assets/js/blocks/checkout/utils.ts
File size: 477 bytes
MIME-type: text/x-java
Charset: utf-8

/**
 * External dependencies
 */
import { LOGIN_URL } from '@woocommerce/block-settings';
import { getSetting } from '@woocommerce/settings';

export const LOGIN_TO_CHECKOUT_URL = `${ LOGIN_URL }?redirect_to=${ encodeURIComponent(
	window.location.href
) }`;

export const isLoginRequired = ( customerId: number ): boolean => {
	return ! customerId && ! getSetting( 'checkoutAllowsGuest', false );
};

export const reloadPage = (): void => void window.location.reload( true );