Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/fulltextsearch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/fulltextsearch.v1.api.js')
-rw-r--r--js/fulltextsearch.v1.api.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/fulltextsearch.v1.api.js b/js/fulltextsearch.v1.api.js
index 394bf4c..ee6b1e6 100644
--- a/js/fulltextsearch.v1.api.js
+++ b/js/fulltextsearch.v1.api.js
@@ -35,7 +35,10 @@ var api = {
search: function (request, callback, callbackError) {
- var res = {status: -1, error: 'failed to connect to Nextcloud'};
+ var res = {
+ status: -1,
+ error: 'failed to connect to Nextcloud'
+ };
nav.onSearchRequest(request);
@@ -52,13 +55,14 @@ var api = {
api.onCallback(callbackError, res);
return;
}
+
result.displayResult(res);
nav.onResultDisplayed(res);
api.onCallback(callback, res);
}).fail(function () {
- nav.failedToAjax(res);
- nav.onError(res.error);
- api.onCallback(callbackError, res);
+ if (!api.onCallback(callbackError, res)) {
+ nav.onError('Failed to reach server. Try reloading the page');
+ }
});
},
@@ -86,7 +90,11 @@ var api = {
} else {
callback({status: -1});
}
+
+ return true;
}
+
+ return false;
}
};