Skip to content

Commit

Permalink
fix: Add fallback for state
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Nov 11, 2024
1 parent 8fd9656 commit 3e3a016
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/util/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ export const loadState = (data: string): void => {
console.log(`Loading '${data}'`);
try {
state = deserializeState(data);
if (!state.mermaid) {
state.mermaid = defaultState.mermaid;
}
const mermaidConfig: MermaidConfig =
typeof state.mermaid === 'string'
? (JSON.parse(state.mermaid) as MermaidConfig)
Expand Down

0 comments on commit 3e3a016

Please sign in to comment.