Добавление событий, рефакторинг

This commit is contained in:
Book Pauk
2019-03-20 14:57:40 +07:00
parent b12198fdcf
commit 090ffa9921
3 changed files with 21 additions and 11 deletions

View File

@@ -127,7 +127,6 @@ class HistoryPage extends Vue {
init() {
this.updateTableData();
this.mostRecentBook = bookManager.mostRecentBook();
this.$nextTick(() => {
this.$refs.input.focus();
});
@@ -239,13 +238,7 @@ class HistoryPage extends Vue {
await bookManager.delRecentBook({key});
this.updateTableData();
const newRecent = bookManager.mostRecentBook();
if (!(this.mostRecentBook && newRecent && this.mostRecentBook.key == newRecent.key))
this.$emit('load-book', newRecent);
this.mostRecentBook = newRecent;
if (!this.mostRecentBook)
if (!bookManager.mostRecentBook())
this.close();
}