How to use the @shopify/app-bridge/actions.History.Action function in @shopify/app-bridge

To help you get started, we’ve selected a few @shopify/app-bridge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Shopify / quilt / packages / react-shopify-app-route-propagator / src / hook.ts View on Github external
if (renderedInTheTopWindow || renderedInAModal) {
      return;
    }

    const normalizedLocation = getNormalizedURL(location);

    /*
      We delete this param that ends up unnecassarily stuck on
      the iframe due to oauth when propagating up.
    */
    normalizedLocation.searchParams.delete('hmac');

    const {pathname, search, hash} = normalizedLocation;
    const locationStr = `${pathname}${search}${hash}`;

    history.dispatch(History.Action.REPLACE, locationStr);
  }, [history, location]);
}