fix: also submit current label when changing screenshot image

This commit is contained in:
P. Reis 2024-11-23 15:37:28 -03:00
parent 18832c69cc
commit 8ba7214718
1 changed files with 2 additions and 2 deletions

View File

@ -278,9 +278,9 @@ const ScreenshotInput: StreamfieldComponent<Screenshot> = ({ value, onChange })
const height = attachment?.meta?.getIn(['original', 'height']);
if (typeof width === 'number' && typeof height === 'number') {
onChange({ ...value, [key]: attachment.get('url'), ['sizes']: `${width}x${height}` });
onChange({ ...value, [key]: attachment.get('url'), ['sizes']: `${width}x${height}`, 'label': value.label });
} else {
onChange({ ...value, [key]: attachment.get('url') });
onChange({ ...value, [key]: attachment.get('url'), 'label': value.label });
}
toast.success(messages.upload_screenshot_success);