Skip to content

Commit

Permalink
fix: handle fields missing from installation parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinwysocki committed Sep 26, 2023
1 parent ef64828 commit 146c570
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/surfer/src/locations/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ const Sidebar = () => {
const { entry, window, parameters } = useSDK<SidebarAppSDK>();

const richTextFields = Object.values(entry.fields).filter(isRichText);
const selectedFields = parameters?.installation?.selectedContentFields?.[entry.getSys().contentType.sys.id] || [];
const widgetSizePx = richTextFields.length ? FULL_SIZE_PX : WARNING_SIZE_PX;
const contentHtml = useContentHtml(richTextFields, parameters.installation.selectedContentFields[entry.getSys().contentType.sys.id]);
const contentHtml = useContentHtml(richTextFields, selectedFields);

const shareToken = buildShareToken(entry.getSys());
const { openConfigurationDialog, isConfigurationOpen } = useConfigurationDialog(shareToken);
Expand Down

0 comments on commit 146c570

Please sign in to comment.