Fix not numbered inconsistency (#14269)

* fix not numbered field

* fix for adding extra field and removing it from sections

* use const for variable

* use spread operator to create new object

* address pr comments

* change function name and simplify

* Add comment and put the initializeContents in the finally block
This commit is contained in:
Barbara Valdez
2021-02-12 19:17:22 -08:00
committed by GitHub
parent 238a0c60d9
commit 0f748a60b3
3 changed files with 21 additions and 5 deletions

View File

@@ -225,11 +225,11 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
} finally {
try {
await targetBook.initializeContents();
} finally {
if (sourceBook && sourceBook.bookPath !== targetBook.bookPath) {
// refresh source book model to pick up latest changes
await sourceBook.initializeContents();
}
} finally {
this._onDidChangeTreeData.fire(undefined);
// even if it fails, we still need to watch the toc file again.
if (sourceBook) {