Skip to content

Commit

Permalink
[B] Prevent exception for texts without stylesheets
Browse files Browse the repository at this point in the history
  • Loading branch information
zdavis committed Feb 27, 2024
1 parent 2950295 commit 0b016f8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ export default function EditSectionForm({
}, [initialSlateValue, t]);

const stylesheetData = useFromStore(`entityStore.entities.stylesheets`);
const stylesheetDataKeys = stylesheetData ? Object.keys(stylesheetData) : [];

const appliedStylesheets = Object.keys(stylesheetData)
const appliedStylesheets = stylesheetDataKeys
.filter(id => appliesToAllStylesheets.find(s => s === id))
.map(id => stylesheetData[id]);

Expand Down

0 comments on commit 0b016f8

Please sign in to comment.