Рефакторинг

This commit is contained in:
Book Pauk
2022-10-24 17:31:21 +07:00
parent 634d646622
commit fd93d3f523
2 changed files with 7 additions and 9 deletions

View File

@@ -189,7 +189,6 @@ class AuthorList extends BaseList {
list: Object, list: Object,
search: Object, search: Object,
genreMap: Object, genreMap: Object,
liberamaReady: Boolean,
}; };
loadingMessage = ''; loadingMessage = '';
@@ -243,7 +242,7 @@ class AuthorList extends BaseList {
} }
get showReadLink() { get showReadLink() {
return this.config.bookReadLink != '' || this.liberamaReady; return this.config.bookReadLink != '' || this.list.liberamaReady;
} }
showHiddenHelp() { showHiddenHelp() {
@@ -356,7 +355,7 @@ class AuthorList extends BaseList {
поэтому повторная попытка должна быть успешной.`, 'Ошибка'); поэтому повторная попытка должна быть успешной.`, 'Ошибка');
} else if (action == 'readBook') { } else if (action == 'readBook') {
//читать //читать
if (this.liberamaReady) { if (this.list.liberamaReady) {
this.sendMessage({type: 'submitUrl', data: href}); this.sendMessage({type: 'submitUrl', data: href});
} else { } else {
const url = this.config.bookReadLink.replace('${DOWNLOAD_LINK}', href); const url = this.config.bookReadLink.replace('${DOWNLOAD_LINK}', href);

View File

@@ -111,7 +111,7 @@
</div> </div>
<!-- Формирование списка ------------------------------------------------------------------------> <!-- Формирование списка ------------------------------------------------------------------------>
<AuthorList :ready="ready" :list="list" :search="search" :genre-map="genreMap" :liberama-ready="liberamaReady" @list-event="listEvent" /> <AuthorList :ready="ready" :list="list" :search="search" :genre-map="genreMap" @list-event="listEvent" />
<!-- Формирование списка конец ------------------------------------------------------------------> <!-- Формирование списка конец ------------------------------------------------------------------>
<div class="row justify-center"> <div class="row justify-center">
@@ -289,6 +289,7 @@ class Search {
queryFound: -1, queryFound: -1,
totalFound: 0, totalFound: 0,
inpxHash: '', inpxHash: '',
liberamaReady: false,
}; };
genreTree = []; genreTree = [];
@@ -310,8 +311,6 @@ class Search {
searchResult = {}; searchResult = {};
tableData = []; tableData = [];
liberamaReady = false;
created() { created() {
this.commit = this.$store.commit; this.commit = this.$store.commit;
this.api = this.$root.api; this.api = this.$root.api;
@@ -365,7 +364,7 @@ class Search {
if (d.type == 'mes') { if (d.type == 'mes') {
switch(d.data) { switch(d.data) {
case 'ready': case 'ready':
this.liberamaReady = true; this.list.liberamaReady = true;
this.sendMessage({type: 'mes', data: 'ready'}); this.sendMessage({type: 'mes', data: 'ready'});
this.sendCurrentUrl(); this.sendCurrentUrl();
break; break;
@@ -447,7 +446,7 @@ class Search {
} }
this.$root.setAppTitle(result); this.$root.setAppTitle(result);
if (this.liberamaReady) if (this.list.liberamaReady)
this.sendMessage({type: 'titleChange', data: result}); this.sendMessage({type: 'titleChange', data: result});
} }
@@ -672,7 +671,7 @@ class Search {
} }
async updateSearchFromRouteQuery(to) { async updateSearchFromRouteQuery(to) {
if (this.liberamaReady) if (this.list.liberamaReady)
this.sendCurrentUrl(); this.sendCurrentUrl();
if (this.routeUpdating) if (this.routeUpdating)