diff --git a/sites/org/page-templates/edit-pattern.mjs b/sites/org/page-templates/edit-pattern.mjs index 41d8ac8bee2..921d474deb7 100644 --- a/sites/org/page-templates/edit-pattern.mjs +++ b/sites/org/page-templates/edit-pattern.mjs @@ -21,7 +21,7 @@ import { Loading } from 'shared/components/spinner.mjs' const ns = nsMerge('$$design$$', wbNs, pageNs) const EditDesignComponent = ({ id, design, Design, settings }) => ( - + ) const Edit$$Design$$Page = ({ page }) => { diff --git a/sites/shared/components/workbench/new.mjs b/sites/shared/components/workbench/new.mjs index 13d0d751073..9ba930a8de6 100644 --- a/sites/shared/components/workbench/new.mjs +++ b/sites/shared/components/workbench/new.mjs @@ -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) diff --git a/sites/shared/components/workbench/views/draft/header.mjs b/sites/shared/components/workbench/views/draft/header.mjs index e599bff5924..57c5bfcbe6c 100644 --- a/sites/shared/components/workbench/views/draft/header.mjs +++ b/sites/shared/components/workbench/views/draft/header.mjs @@ -3,7 +3,7 @@ import { capitalize, shortDate } from 'shared/utils.mjs' import { controlLevels } from 'shared/config/freesewing.config.mjs' // Hooks -import { useEffect, useContext, useMemo } from 'react' +import { useContext, useMemo } from 'react' import { useMobileAction } from 'shared/context/mobile-menubar-context.mjs' import { useTranslation } from 'next-i18next' import { useBackend } from 'shared/hooks/use-backend.mjs' @@ -99,32 +99,19 @@ export const DraftHeader = ({ // add the zoom buttons as an action on the mobile menubar useMobileAction('zoom', { order: 0, actionContent: headerZoomButtons }) - /* - * This saves the pattern on intial load which side-steps #5534 until - * we figure out what's causing it exactly - */ - useEffect(() => { - if (saveAs && saveAs.edit === 0) { - savePattern(true) - saveAs.edit++ - } - }, [saveAs]) - - const savePattern = async (silent = false) => { - if (!silent) setLoadingStatus([true, 'savingPattern']) + const savePattern = async () => { + setLoadingStatus([true, 'savingPattern']) const result = await backend.updatePattern(saveAs.pattern, { settings }) - if (!silent) { - if (result.success) - setLoadingStatus([ - true, - <> - {t('status:patternSaved')} [#{saveAs.pattern}] - , - true, - true, - ]) - else setLoadingStatus([true, 'backendError', true, false]) - } + if (result.success) + setLoadingStatus([ + true, + <> + {t('status:patternSaved')} [#{saveAs.pattern}] + , + true, + true, + ]) + else setLoadingStatus([true, 'backendError', true, false]) } const bookmarkPattern = async () => {