mirror of
https://github.com/zadam/trilium.git
synced 2026-03-06 12:10:54 +01:00
fix(spreadsheet): error due to duplicate unit IDs
This commit is contained in:
@@ -82,6 +82,12 @@ function usePersistence(note: FNote, noteContext: NoteContext | null | undefined
|
||||
const univerAPI = apiRef.current;
|
||||
if (!univerAPI) return undefined;
|
||||
|
||||
// Dispose the existing workbook.
|
||||
const existingNotebook = univerAPI.getActiveWorkbook();
|
||||
if (existingNotebook) {
|
||||
univerAPI.disposeUnit(existingNotebook.getId());
|
||||
}
|
||||
|
||||
let workbook: Partial<IWorkbookData> = {};
|
||||
if (newContent) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user