浏览代码

Небольшие поправки

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

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

@@ -295,7 +295,9 @@ class Reader extends Vue {
             this.updateRoute();
             this.updateRoute();
         }, 1000);
         }, 1000);
 
 
-        this.debouncedSetRecentBook = _.debounce(async(newValue) => {
+        this.debouncedSetRecentBook = _.throttle(async(newValue) => {
+            await utils.sleep(300);
+            
             const recent = this.mostRecentBook();
             const recent = this.mostRecentBook();
             if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) {
             if (recent && (recent.bookPos != newValue || recent.bookPosSeen !== this.bookPosSeen)) {
                 await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen}));
                 await bookManager.setRecentBook(Object.assign({}, recent, {bookPos: newValue, bookPosSeen: this.bookPosSeen}));