From 53078f41a08d8be678bf12eb21f285f3d7a83940 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sun, 17 Nov 2019 02:11:27 +0100 Subject: [PATCH] Frontend: Run import / index in background (cancel request) Signed-off-by: Michael Mayer --- frontend/src/common/api.js | 4 ++++ frontend/src/pages/library/import.vue | 24 ++++++++++++++++++++++-- frontend/src/pages/library/index.vue | 26 +++++++++++++++++++++++--- internal/photoprism/indexer.go | 18 ++++++------------ 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/frontend/src/common/api.js b/frontend/src/common/api.js index 8ec18c1ec..5c9c7f394 100644 --- a/frontend/src/common/api.js +++ b/frontend/src/common/api.js @@ -24,6 +24,10 @@ Api.interceptors.response.use(function (response) { }, function (error) { Notify.ajaxEnd(); + if (Axios.isCancel(error)) { + return Promise.reject(error); + } + if(console && console.log) { console.log(error); } diff --git a/frontend/src/pages/library/import.vue b/frontend/src/pages/library/import.vue index 9cf7297c5..a0bd27a44 100644 --- a/frontend/src/pages/library/import.vue +++ b/frontend/src/pages/library/import.vue @@ -27,6 +27,8 @@