Рефакторинг
This commit is contained in:
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user