From ed4313b77bbf27d27e5394f3c16299d639d90ae4 Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Wed, 26 Oct 2022 01:48:14 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D0=B8=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Search/AuthorList/AuthorList.vue | 18 ++++++++---------- .../Search/SeriesList/SeriesList.vue | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/client/components/Search/AuthorList/AuthorList.vue b/client/components/Search/AuthorList/AuthorList.vue index c26f469..edd37fd 100644 --- a/client/components/Search/AuthorList/AuthorList.vue +++ b/client/components/Search/AuthorList/AuthorList.vue @@ -409,18 +409,18 @@ class AuthorList extends BaseList { return; this.refreshing = true; + + (async() => { + await utils.sleep(500); + if (this.refreshing) + this.loadingMessage = 'Поиск серий...'; + })(); + try { while (this.queryExecute) { const query = this.queryExecute; this.queryExecute = null; - let inSearch = true; - (async() => { - await utils.sleep(500); - if (inSearch) - this.loadingMessage = 'Поиск авторов...'; - })(); - try { const result = await this.api.authorSearch(query); @@ -438,13 +438,11 @@ class AuthorList extends BaseList { } } catch (e) { this.$root.stdDialog.alert(e.message, 'Ошибка'); - } finally { - inSearch = false; - this.loadingMessage = ''; } } } finally { this.refreshing = false; + this.loadingMessage = ''; } } } diff --git a/client/components/Search/SeriesList/SeriesList.vue b/client/components/Search/SeriesList/SeriesList.vue index d93c3ae..538990d 100644 --- a/client/components/Search/SeriesList/SeriesList.vue +++ b/client/components/Search/SeriesList/SeriesList.vue @@ -241,18 +241,18 @@ class SeriesList extends BaseList { return; this.refreshing = true; + + (async() => { + await utils.sleep(500); + if (this.refreshing) + this.loadingMessage = 'Поиск серий...'; + })(); + try { while (this.queryExecute) { const query = this.queryExecute; this.queryExecute = null; - let inSearch = true; - (async() => { - await utils.sleep(500); - if (inSearch) - this.loadingMessage = 'Поиск серий...'; - })(); - try { const result = await this.api.seriesSearch(query); @@ -270,13 +270,11 @@ class SeriesList extends BaseList { } } catch (e) { this.$root.stdDialog.alert(e.message, 'Ошибка'); - } finally { - inSearch = false; - this.loadingMessage = ''; } } } finally { this.refreshing = false; + this.loadingMessage = ''; } } }