1
0
Fork 0

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:
1372209603
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 <ben-git@swinglonga.com>
Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/353
Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org>
Co-authored-by: Benjamin Fan <benjamesben@noreply.codeberg.org>
Co-committed-by: Benjamin Fan <benjamesben@noreply.codeberg.org>
This commit is contained in:
Benjamin Fan 2025-05-18 10:01:31 +00:00 committed by Joost De Cock
parent 74ba6c2329
commit 64223a141a

View file

@ -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])