Доделки загрузки книг

This commit is contained in:
Book Pauk
2019-02-03 23:23:59 +07:00
parent ce6f41dbe4
commit bc0b0d6e04
3 changed files with 13 additions and 5 deletions

View File

@@ -148,6 +148,7 @@ class Reader extends Vue {
mostRecentBookReactive = null;
created() {
this.loading = true;
this.commit = this.$store.commit;
this.dispatch = this.$store.dispatch;
this.reader = this.$store.state.reader;
@@ -187,6 +188,7 @@ class Reader extends Vue {
this.loaderActive = true;
}
}
this.loading = false;
})();
}
@@ -471,7 +473,7 @@ class Reader extends Vue {
else if (this.mostRecentBookReactive)
result = 'TextPage';
if (!result) {
if (!result && !this.loading) {
this.loaderActive = true;
result = 'LoaderPage';
}
@@ -484,7 +486,7 @@ class Reader extends Vue {
//акивируем страницу с текстом
this.$nextTick(async() => {
const last = this.mostRecentBookReactive;
const isParsed = await bookManager.hasBookParsed(last);
const isParsed = bookManager.hasBookParsed(last);
if (!isParsed) {
this.$root.$emit('set-app-title');
return;
@@ -511,6 +513,13 @@ class Reader extends Vue {
return;
}
// уже просматривается сейчас
const recent = this.mostRecentBook();
if (recent && recent.url == opts.url && bookManager.hasBookParsed(recent)) {
this.loaderActive = false;
return;
}
this.progressActive = true;
this.$nextTick(async() => {
const progress = this.$refs.page;