diff --git a/core/js/oc-vcategories.js b/core/js/oc-vcategories.js index d5a9b0016d..4d8d010a36 100644 --- a/core/js/oc-vcategories.js +++ b/core/js/oc-vcategories.js @@ -84,16 +84,16 @@ OCCategories={ }, rescan:function(){ console.log('Categories.rescan'); - $.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),{},function(jsondata, status, xhr){ - if (status == 'error' && xhr.status == 404) { - OC.dialogs.alert('The required file ' + OC.filePath(Categories.app, 'ajax', 'categories/rescan.php') + ' is not installed!', 'Error'); - return; - } + $.getJSON(OC.filePath(OCCategories.app, 'ajax', 'categories/rescan.php'),function(jsondata, status, xhr){ if(jsondata.status == 'success'){ OCCategories._update(jsondata.data.categories); } else { OC.dialogs.alert(jsondata.data.message, 'Error'); } + }).error(function(xhr){ + if (xhr.status == 404) { + OC.dialogs.alert('The required file ' + OC.filePath(Categories.app, 'ajax', 'categories/rescan.php') + ' is not installed!', 'Error'); + } }); }, _update:function(categories){