MOBILE-2567 database: Fix change detection with number fields
parent
b67a2900eb
commit
d15165ad98
|
@ -50,9 +50,10 @@ export class AddonModDataFieldNumberHandler extends AddonModDataFieldTextHandler
|
|||
*/
|
||||
hasFieldDataChanged(field: any, inputData: any, originalFieldData: any): Promise<boolean> | boolean {
|
||||
const fieldName = 'f_' + field.id,
|
||||
input = typeof inputData[fieldName] != 'undefined' ? parseFloat(inputData[fieldName]) : '';
|
||||
input = typeof inputData[fieldName] != 'undefined' && inputData[fieldName] !== null ?
|
||||
parseFloat(inputData[fieldName]) : '';
|
||||
|
||||
originalFieldData = (originalFieldData && typeof originalFieldData.content != 'undefined') ?
|
||||
originalFieldData = (originalFieldData && typeof originalFieldData.content != 'undefined' && originalFieldData !== null) ?
|
||||
parseFloat(originalFieldData.content) : '';
|
||||
|
||||
return input != originalFieldData;
|
||||
|
|
Loading…
Reference in New Issue