Repository: 4ian/GDevelop
File: newIDE/app/src/ObjectEditor/Editors/CustomObjectPropertiesEditor/index.js (JavaScript)

Code before:
                          </AlertMessage>
                        ))}
                      </ColumnStackLayout>
                    </Line>
                  ) : null}
                  <PropertiesEditor
                    unsavedChanges={unsavedChanges}
                    schema={propertiesSchema}
                    instances={[customObjectConfiguration]}
                    project={project}
                    resourceManagementProps={resourceManagementProps}
                  />
                  {!customObjectConfiguration.isForcedToOverrideEventsBasedObjectChildrenConfiguration() && (
                    <>
                      <Line>
                        <Column expand noMargin>
                          <Text size="block-title">Variant</Text>
                        </Column>
                      </Line>
                      <ColumnStackLayout expand noMargin>
                        <LineStackLayout>
                          <FlatButton
                            label={<Trans>Edit</Trans>}
                            leftIcon={<Edit />}
                            onClick={editVariant}
                            // Avoid to loose user changes by forcing them
                            // to duplicate these variants.
                            disabled={
                              !customObjectEventsBasedObject ||
                              // Variants from the asset store are reset when
                              // creating a new object with the same asset.
                              getVariant(
                                customObjectEventsBasedObject,
                                customObjectConfiguration
                              ).getAssetStoreAssetId() !== '' ||
                              // The default variant is reset when updating
                              // the extension.
                              (!variantName &&
                                !!customObjectExtension &&
                                customObjectExtension.getOriginName() ===
                                  'gdevelop-extension-store')
                            }
                          />
                          <FlatButton
                            label={<Trans>Duplicate</Trans>}
                            leftIcon={<Add />}
                            onClick={() => setNewVariantDialogOpen(true)}
                          />
                          <FlatButton
                            label={<Trans>Delete</Trans>}
                            leftIcon={<Trash />}

Review comment (suggestion):
```suggestion
                            // Avoid to lose user changes by forcing them
```

Code after:
                          </AlertMessage>
                        ))}
                      </ColumnStackLayout>
                    </Line>
                  ) : null}
                  <PropertiesEditor
                    unsavedChanges={unsavedChanges}
                    schema={propertiesSchema}
                    instances={[customObjectConfiguration]}
                    project={project}
                    resourceManagementProps={resourceManagementProps}
                  />
                  {!customObjectConfiguration.isForcedToOverrideEventsBasedObjectChildrenConfiguration() && (
                    <>
                      <Line>
                        <Column expand noMargin>
                          <Text size="block-title">Variant</Text>
                        </Column>
                      </Line>
                      <ColumnStackLayout expand noMargin>
                        <LineStackLayout>
                          <FlatButton
                            label={<Trans>Edit</Trans>}
                            leftIcon={<Edit />}
                            onClick={editVariant}
                            // Avoid to lose user changes by forcing them
                            // to duplicate these variants.
                            disabled={
                              !customObjectEventsBasedObject ||
                              // Variants from the asset store are reset when
                              // creating a new object with the same asset.
                              getVariant(
                                customObjectEventsBasedObject,
                                customObjectConfiguration
                              ).getAssetStoreAssetId() !== '' ||
                              // The default variant is reset when updating
                              // the extension.
                              (!variantName &&
                                !!customObjectExtension &&
                                customObjectExtension.getOriginName() ===
                                  'gdevelop-extension-store')
                            }
                          />
                          <FlatButton
                            label={<Trans>Duplicate</Trans>}
                            leftIcon={<Add />}
                            onClick={() => setNewVariantDialogOpen(true)}
                          />
                          <FlatButton
                            label={<Trans>Delete</Trans>}
                            leftIcon={<Trash />}