1
0
Fork 0

fix(shared): Saving pattern in edit mode

This reverts the temporary fix for #5534
(commit 99b6e75956 )
and implements a proper fix.

This also closes #5570 as that was a side-effect of the initial
half-assed fix.
This commit is contained in:
joostdecock 2023-12-09 16:11:09 +01:00
parent 031be5820b
commit d442e23d69
3 changed files with 16 additions and 30 deletions

View file

@ -105,10 +105,9 @@ export const Workbench = ({ design, Design, saveAs = false, preload = false }) =
// Handle preload
useEffect(() => {
if (preload) {
// This will run a few times while variouos things bootstrap
// This will run a few times while things bootstrap
// but should not run after that.
if (preload.settings && preloaded < 3) {
console.log('preloading settings', { mounted, preloaded })
if (preload.settings && preloaded < 2) {
setSettings(preload.settings)
setView('draft')
setPreloaded(preloaded + 1)