diff --git a/packages/react/components/Account/Pattern.mjs b/packages/react/components/Account/Pattern.mjs index d221eccd5ed..ae2d09bc5a3 100644 --- a/packages/react/components/Account/Pattern.mjs +++ b/packages/react/components/Account/Pattern.mjs @@ -6,6 +6,7 @@ import { shortDate, horFlexClasses, newPatternUrl, + patternUrlFromState, } from '@freesewing/utils' import { urls, control as controlConfig } from '@freesewing/config' @@ -379,7 +380,7 @@ const PatternHeader = ({ {pattern.userId === account.id && ( <> Update Pattern diff --git a/packages/utils/src/index.mjs b/packages/utils/src/index.mjs index 7a88244ef65..8f6747f544a 100644 --- a/packages/utils/src/index.mjs +++ b/packages/utils/src/index.mjs @@ -437,6 +437,8 @@ export const patternUrlFromState = (state = {}, includeMeasurements = false, vie settings, view, } + // When restoring a stored pattern, it will have an ID that we should re-use for saving. + if (state.id) obj.pid = state.id return `/editor/#s=${encodeURIComponent(JSON.stringify(obj))}` }