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:
authorMaxence Lange <maxence@artificial-owl.com>2018-05-12 16:08:09 +0300
committerMaxence Lange <maxence@artificial-owl.com>2018-05-12 16:08:09 +0300
commit85b01696ac50b536363feb53273974bd11947152 (patch)
tree0ece683dbe84bb0df260c0a427af2e77bbffdefc
parent08cbbe46f3d6f671e90a200ae471fc2d736044d1 (diff)
display error on timeout session
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--js/fulltextsearch.v1.api.js16
-rw-r--r--js/fulltextsearch.v1.navigation.js9
2 files changed, 12 insertions, 13 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;
}
};
diff --git a/js/fulltextsearch.v1.navigation.js b/js/fulltextsearch.v1.navigation.js
index d03e047..f9de445 100644
--- a/js/fulltextsearch.v1.navigation.js
+++ b/js/fulltextsearch.v1.navigation.js
@@ -57,15 +57,6 @@ var curr = {
var nav = {
- failedToAjax: function () {
- // OCA.notification.onFail(
- // 'Failed to connect to cloud, page will refresh within few seconds');
- // window.setTimeout(function () {
- // window.location.reload(true);
- // }, 4000);
- },
-
-
manageDivProviderNavigation: function (divProviderNavigation, request, meta) {
var maxPage = Math.ceil(meta.total / request.size);