Ver código fonte

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

Book Pauk 6 anos atrás
pai
commit
3e3f259920

+ 1 - 1
client/components/Reader/Reader.vue

@@ -179,7 +179,7 @@ class Reader extends Vue {
 
         this.debouncedSetRecentBook = _.debounce(async(newValue) => {
             const recent = this.mostRecentBook();
-            if (recent && recent.bookPos != newValue) {
+            if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) {
                 await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen}));
 
                 if (this.actionCur < 0 || (this.actionCur >= 0 && this.actionList[this.actionCur] != newValue))

+ 6 - 2
client/components/Reader/TextPage/TextPage.vue

@@ -45,10 +45,13 @@ const minLayoutWidth = 100;
 
 export default @Component({
     watch: {
-        bookPos: function(newValue) {
-            this.$emit('book-pos-changed', {bookPos: newValue, bookPosSeen: this.bookPosSeen});
+        bookPos: function() {
+            this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
             this.draw();
         },
+        bookPosSeen: function() {
+            this.$emit('book-pos-changed', {bookPos: this.bookPos, bookPosSeen: this.bookPosSeen});
+        },
         settings: function() {
             this.debouncedLoadSettings();
         },
@@ -69,6 +72,7 @@ class TextPage extends Vue {
 
     lastBook = null;
     bookPos = 0;
+    bookPosSeen = null;
 
     fontStyle = null;
     fontSize = null;