Browse Source

Поправки багов

Book Pauk 6 years ago
parent
commit
5198e3f7ba
1 changed files with 15 additions and 3 deletions
  1. 15 3
      client/components/Reader/TextPage/TextPage.vue

+ 15 - 3
client/components/Reader/TextPage/TextPage.vue

@@ -50,14 +50,15 @@ class TextPage extends Vue {
         this.fb2 = null;
         this.fb2 = null;
 
 
         let last = this.lastOpenedBook;
         let last = this.lastOpenedBook;
-        if (last) {
+
+        if (last && !(this.routeParamUrl && this.routeParamUrl != last.url)) {
             (async() => {
             (async() => {
                 const isParsed = await bookManager.hasBookParsed(last);
                 const isParsed = await bookManager.hasBookParsed(last);
                 if (!isParsed) {
                 if (!isParsed) {
                     this.$root.$emit('set-app-title');
                     this.$root.$emit('set-app-title');
-                    if (this.lastOpenTry != last) {
+                    if (this.lastOpenTry != last.url) {
                         this.$emit('parse-book', last);
                         this.$emit('parse-book', last);
-                        this.lastOpenTry = last;
+                        this.lastOpenTry = last.url;
                     }
                     }
                     return;
                     return;
                 }
                 }
@@ -84,6 +85,17 @@ class TextPage extends Vue {
         return this.$store.getters['reader/lastOpenedBook'];
         return this.$store.getters['reader/lastOpenedBook'];
     }
     }
 
 
+    get routeParamUrl() {
+        let result = '';
+        const path = this.$route.fullPath;
+        const i = path.indexOf('url=');
+        if (i >= 0) {
+            result = path.substr(i + 4);
+        }
+        
+        return decodeURIComponent(result);
+    }
+
     get routeParamPos() {
     get routeParamPos() {
         let result = undefined;
         let result = undefined;
         const q = this.$route.query;
         const q = this.$route.query;