From 142b7674706d0ae08b6c03a411933c0e24ea7ecb Mon Sep 17 00:00:00 2001 From: Nikhil Date: Mon, 19 Oct 2020 17:57:57 -0700 Subject: [PATCH] [Notebook] new notebook entry causes console error #3440 (#3443) * [Notebook] new notebook entry causes console error #3440 * using 'makeKeyString' to compare notebook identifiers Co-authored-by: Deep Tailor --- src/plugins/notebook/components/Notebook.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/notebook/components/Notebook.vue b/src/plugins/notebook/components/Notebook.vue index 0927c45083..ff2ae94ef4 100644 --- a/src/plugins/notebook/components/Notebook.vue +++ b/src/plugins/notebook/components/Notebook.vue @@ -112,6 +112,8 @@ import SearchResults from './SearchResults.vue'; import Sidebar from './Sidebar.vue'; import { clearDefaultNotebook, getDefaultNotebook, setDefaultNotebook, setDefaultNotebookSection, setDefaultNotebookPage } from '../utils/notebook-storage'; import { DEFAULT_CLASS, addNotebookEntry, createNewEmbed, getNotebookEntries } from '../utils/notebook-entries'; +import objectUtils from 'objectUtils'; + import { throttle } from 'lodash'; export default { @@ -431,7 +433,9 @@ export default { }, async updateDefaultNotebook(notebookStorage) { const defaultNotebookObject = await this.getDefaultNotebookObject(); - if (defaultNotebookObject.identifier.key !== notebookStorage.notebookMeta.identifier.key) { + if (!defaultNotebookObject) { + setDefaultNotebook(this.openmct, notebookStorage); + } else if (objectUtils.makeKeyString(defaultNotebookObject.identifier) !== objectUtils.makeKeyString(notebookStorage.notebookMeta.identifier)) { this.removeDefaultClass(defaultNotebookObject); setDefaultNotebook(this.openmct, notebookStorage); }