mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Fix book editing issues (#14177)
* Fix issue moving a duplicated section to another book
This commit is contained in:
@@ -213,9 +213,9 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
const sourceBook = this.books.find(book => book.bookPath === movingElement.book.root);
|
||||
const targetBook = this.books.find(book => book.bookPath === updateBook.book.root);
|
||||
this.bookTocManager = new BookTocManager(targetBook, sourceBook);
|
||||
// remove watch on toc file from both books.
|
||||
// remove watch on toc file from source book.
|
||||
if (sourceBook) {
|
||||
fs.unwatchFile(movingElement.tableOfContentsPath);
|
||||
fs.unwatchFile(sourceBook.tableOfContentsPath);
|
||||
}
|
||||
try {
|
||||
await this.bookTocManager.updateBook(movingElement, updateBook, targetSection);
|
||||
@@ -232,7 +232,6 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
|
||||
if (sourceBook) {
|
||||
this.setFileWatcher(sourceBook);
|
||||
}
|
||||
this.setFileWatcher(targetBook);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user