Apply suggestions from code review

Co-authored-by: Casper Lamboo <c.lamboo@ultimaker.com>
Co-authored-by: Jelle Spijker <j.spijker@ultimaker.com>
This commit is contained in:
Joey de l'Arago 2022-12-12 11:44:21 +01:00 committed by GitHub
parent e03b4e07f9
commit 1e6184448c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 26 additions and 25 deletions

View file

@ -87,13 +87,13 @@ UM.TextField
function parseValueUpdateSetting()
{
if (propertyProvider.properties.value == text || (parseFloat(propertyProvider.properties.value) == parseFloat(text) && !isNan(parseFloat(text))))
if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text)))
{
// Don't set the property value from the control. It already has the same value
return
}
if (propertyProvider && text != propertyProvider.properties.value)
if (propertyProvider && text !== propertyProvider.properties.value)
{
updateSetting(text);
}
@ -119,7 +119,7 @@ UM.TextField
State
{
name: "validationError"
when: propertyProvider.properties.validationState == "ValidatorState.Exception" || propertyProvider.properties.validationState == "ValidatorState.MinimumError" || propertyProvider.properties.validationState == "ValidatorState.MaximumError"
when: propertyProvider.properties.validationState === "ValidatorState.Exception" || propertyProvider.properties.validationState === "ValidatorState.MinimumError" || propertyProvider.properties.validationState === "ValidatorState.MaximumError"
PropertyChanges
{
target: background
@ -130,7 +130,7 @@ UM.TextField
State
{
name: "validationWarning"
when: propertyProvider.properties.validationState == "ValidatorState.MinimumWarning" || propertyProvider.properties.validationState == "ValidatorState.MaximumWarning"
when: propertyProvider.properties.validationState === "ValidatorState.MinimumWarning" || propertyProvider.properties.validationState === "ValidatorState.MaximumWarning"
PropertyChanges
{
target: background