浏览代码

Улучшение синхронизации

Book Pauk 5 年之前
父节点
当前提交
fd0f523c64
共有 2 个文件被更改,包括 3 次插入0 次删除
  1. 2 0
      client/components/Reader/Reader.vue
  2. 1 0
      client/components/Reader/share/bookManager.js

+ 2 - 0
client/components/Reader/Reader.vue

@@ -510,7 +510,9 @@ class Reader extends Vue {
             if (this.recentBooksActive) {
                 await this.$refs.recentBooksPage.updateTableData();
             }
+        }
 
+        if (eventName == 'set-recent') {
             const oldBook = this.mostRecentBookReactive;
             const newBook = bookManager.mostRecentBook();
             if (oldBook && newBook) {

+ 1 - 0
client/components/Reader/share/bookManager.js

@@ -450,6 +450,7 @@ class BookManager {
         await bmRecentStore.setItem('recent-last', this.recentLast);
 
         this.recentChanged = true;
+        this.emit('set-recent');
         this.emit('recent-changed');
     }