From 04f20dcc9682f34b579c5ae506093a8ad3e93868 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Tue, 2 Jul 2024 10:02:41 -0400 Subject: [PATCH 1/2] chore: remove redundant comments --- src/CressView.ts | 16 ---------------- src/utils/Unsaved.ts | 2 +- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/src/CressView.ts b/src/CressView.ts index 14296e0..db31a4e 100644 --- a/src/CressView.ts +++ b/src/CressView.ts @@ -1,5 +1,4 @@ import setBody from './utils/Template'; -import * as Validation from './Validation'; import { ModalWindow } from './utils/ModalWindow'; import { CressTable } from './Editor/CressTable'; import { ModalWindowInterface } from './Interfaces'; @@ -51,21 +50,6 @@ class CressView { }) .then(() => {}); } - - /** - * Save the current state to the browser database. - */ - // save (): Promise { - // setSavedStatus(true); - // return this.core.updateDatabase(); - // } - - /** - * Deletes the local database of the loaded MEI file(s). - */ - // deleteDb (): Promise { - // return this.core.deleteDb(); - // } } export { CressView as default }; diff --git a/src/utils/Unsaved.ts b/src/utils/Unsaved.ts index e69d367..89d8387 100644 --- a/src/utils/Unsaved.ts +++ b/src/utils/Unsaved.ts @@ -16,7 +16,7 @@ function updateIndicator(): void { } /** - * Set the saved status of the folio + * Set the saved status of the file * * @param status boolean value. true if status is "saved", false if "not saved" */ From 888f8dc79e79d6f7fa541e5b48b5ff9ea67d6b77 Mon Sep 17 00:00:00 2001 From: Yinan Zhou Date: Tue, 2 Jul 2024 10:27:21 -0400 Subject: [PATCH 2/2] fix: update saved status if not loading data Resolves: #86 --- src/Editor/CressTable.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Editor/CressTable.ts b/src/Editor/CressTable.ts index 48cf816..8cb6be6 100644 --- a/src/Editor/CressTable.ts +++ b/src/Editor/CressTable.ts @@ -65,8 +65,8 @@ export class CressTable { dropdownMenu: true, className: 'table-menu-btn', licenseKey: 'non-commercial-and-evaluation', - afterChange() { - setSavedStatus(false); + afterChange(changes, source) { + if (source != 'loadData') setSavedStatus(false); this.validateCells(); }, beforeValidate: (value) => this.setProcessStatus(value),