Рефакторинг
This commit is contained in:
@@ -409,18 +409,18 @@ class AuthorList extends BaseList {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.refreshing = true;
|
this.refreshing = true;
|
||||||
|
|
||||||
|
(async() => {
|
||||||
|
await utils.sleep(500);
|
||||||
|
if (this.refreshing)
|
||||||
|
this.loadingMessage = 'Поиск серий...';
|
||||||
|
})();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (this.queryExecute) {
|
while (this.queryExecute) {
|
||||||
const query = this.queryExecute;
|
const query = this.queryExecute;
|
||||||
this.queryExecute = null;
|
this.queryExecute = null;
|
||||||
|
|
||||||
let inSearch = true;
|
|
||||||
(async() => {
|
|
||||||
await utils.sleep(500);
|
|
||||||
if (inSearch)
|
|
||||||
this.loadingMessage = 'Поиск авторов...';
|
|
||||||
})();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await this.api.authorSearch(query);
|
const result = await this.api.authorSearch(query);
|
||||||
|
|
||||||
@@ -438,13 +438,11 @@ class AuthorList extends BaseList {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
||||||
} finally {
|
|
||||||
inSearch = false;
|
|
||||||
this.loadingMessage = '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.refreshing = false;
|
this.refreshing = false;
|
||||||
|
this.loadingMessage = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -241,18 +241,18 @@ class SeriesList extends BaseList {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
this.refreshing = true;
|
this.refreshing = true;
|
||||||
|
|
||||||
|
(async() => {
|
||||||
|
await utils.sleep(500);
|
||||||
|
if (this.refreshing)
|
||||||
|
this.loadingMessage = 'Поиск серий...';
|
||||||
|
})();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
while (this.queryExecute) {
|
while (this.queryExecute) {
|
||||||
const query = this.queryExecute;
|
const query = this.queryExecute;
|
||||||
this.queryExecute = null;
|
this.queryExecute = null;
|
||||||
|
|
||||||
let inSearch = true;
|
|
||||||
(async() => {
|
|
||||||
await utils.sleep(500);
|
|
||||||
if (inSearch)
|
|
||||||
this.loadingMessage = 'Поиск серий...';
|
|
||||||
})();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const result = await this.api.seriesSearch(query);
|
const result = await this.api.seriesSearch(query);
|
||||||
|
|
||||||
@@ -270,13 +270,11 @@ class SeriesList extends BaseList {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
this.$root.stdDialog.alert(e.message, 'Ошибка');
|
||||||
} finally {
|
|
||||||
inSearch = false;
|
|
||||||
this.loadingMessage = '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
this.refreshing = false;
|
this.refreshing = false;
|
||||||
|
this.loadingMessage = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user