Sitecore / jss

Software development kit for JavaScript developers building web applications with Sitecore Experience Platform
https://jss.sitecore.com
Apache License 2.0
263 stars 275 forks source link

[angular][xmcloud] Do not initialize CloudSDK if we are in edit or preview mode #1961

Closed yavorsk closed 3 weeks ago

yavorsk commented 3 weeks ago

Description / Motivation

This PR modifies cloudsk init component to not initialize CloudSDK in the browser if we are in edit or preview mode or route data is missing.

Testing Details

Types of changes

illiakovalenko commented 3 weeks ago

@yavorsk Another thing that I observed, that when I navigate using client side routing - cloudsdk is initialized on each route change, while it should be initialized once, on the first visit. Also I don't know if it's fine for cloudsdk if "init" will be called multiple times