diff options
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | www/js/views/details.js | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8da9759..bb3b239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ - New features - Multiple photo support. #107 - iPhone X support. #259 + - Bugfixes + - Skip empty report details screen. - Development improvements - CONFIG.SKIP_CONFIRM_REPORT flag to skip confirmation screen - Ensure compatibility with latest Cordova versions. diff --git a/www/js/views/details.js b/www/js/views/details.js index 9f03d58..f2de9d8 100644 --- a/www/js/views/details.js +++ b/www/js/views/details.js @@ -87,8 +87,18 @@ timeout: 30000, success: function( data, status ) { if ( data && data.category_extra && data.category_extra.length > 0 ) { - that.model.set('category_extras', data.category_extra); - that.navigate('details_extra'); + // Some categories have only hidden fields - in that case we + // don't want to navigate to the details_extra view. + var all_hidden = data.category_extra_json.reduce(function(accumulator, field) { + return accumulator && (field.automated === "hidden_field"); + }, true); + + if (all_hidden) { + that.navigate( that.next ); + } else { + that.model.set('category_extras', data.category_extra); + that.navigate('details_extra'); + } } else { that.navigate( that.next ); } |