External Display Conditions Extension to reproduce issues here
- Clone the repository.
- Copy
.env.sampleto.envand fill in your values: - Install Dependencies
npm install
npm run devWhen loading the editor for the first time, the editor will be loaded with the default template.json.
This template contains an existing condition with extraData.
When opening the console, we can see that the extraData is empty.
STR:
-
Stop the app if it is running.
a. Change the emailId passed to the editor in creds.js. Let's call it
"emailIdToto"b. Change the port in vite.config.js (ex: 5002) and run
npm run devagain.
Content loaded correctly
- Update the editor content. Ex: We add a button
"Will be Saved to Local Storage". Click save button (it will get the current editor template and save it to localStorage)
- Reload the page. we pass the template loaded from localStorage (the one we save above) to the editor. But the editor keeps showing the initial template (maybe it retrieves it from stripo reference database).
When we log the console, we notice that the template passed to the editor is the one from the localStorage (the one with button "Will be Saved to Local Storage"). Alright.
But it is not the one loaded in the editor as you can see it above
- Try to update manually the template in
onTemplateLoadedoptions by usingStripoEditorApi.actionsApi.updateHtmlAndCss
- Reload the page. The editor first load the wrong template, then update it with the correct template, after
onTemplateLoaded
Expected behavior: the template we pass to the editor must be the one loaded, even if we use the same emailId to load different templates