From 64223a141aa16a03847394df6ed6a9cf25cb00fb Mon Sep 17 00:00:00 2001 From: Benjamin Fan Date: Sun, 18 May 2025 10:01:31 +0000 Subject: [PATCH] fix(react): Pattern clone fix and improvment (#353) This PR: 1. Fixes an issue where the pattern clone operation fails, resulting in a hang/freeze. 2. Appends " (clone)" text to the cloned pattern's name. The hang/freeze problem was reported on Discord: https://discord.com/channels/698854858052075530/944926520282054666/1372209603080753212 discord://discord.com/channels/698854858052075530/944926520282054666/1372209603080753212 Because a successful pattern clone operation immediately loads the new, cloned pattern in the browser, the loading status "success" message is not seen by the user. Instead the user sees the new pattern, but because the new pattern looks exactly like the old pattern, it is not immediately clear to the user that the operation succeeded. This PR adds " (clone)" to the cloned pattern's name, making it easier to see that the clone operation succeeded and than the user is actually looking at the new, cloned pattern. It also helps differentiate the new, cloned pattern from the original pattern. Co-authored-by: Benjamin Fan Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/353 Reviewed-by: Joost De Cock Co-authored-by: Benjamin Fan Co-committed-by: Benjamin Fan --- packages/react/components/Account/Pattern.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/components/Account/Pattern.mjs b/packages/react/components/Account/Pattern.mjs index 34f53caffa9..0346f1ca0f0 100644 --- a/packages/react/components/Account/Pattern.mjs +++ b/packages/react/components/Account/Pattern.mjs @@ -109,7 +109,7 @@ export const Pattern = ({ id, Link }) => { delete data.data delete data.userId delete data.img - data.settings = JSON.parse(data.settings) + data.name += ' (clone)' const [status, body] = await backend.createPattern(data) if (status === 201 && body.result === 'created') { setLoadingStatus([true, 'Loading newly created pattern', true, true])