diff --git a/src/workspace.ts b/src/workspace.ts index c6bb6a1..bc768b8 100644 --- a/src/workspace.ts +++ b/src/workspace.ts @@ -54,10 +54,11 @@ export class Workspace { invalidate(sheetId: string): void { this.titleCache = null; const dirty = new Set([sheetId]); + const sheetsList = this.sheets(); let changed = true; while (changed) { changed = false; - for (const s of this.sheets()) { + for (const s of sheetsList) { if (dirty.has(s.id)) continue; for (const title of this.referencedTitles(s.text, s.id)) { const target = this.findSheetByTitle(title);