Skip to content

Commit 1bc0eb9

Browse files
committed
Fix #775 handle inline dialogs in dialog_list preview
1 parent edf72dd commit 1bc0eb9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/app/components/previews/DialogPreview.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ function DialogActions({ dialog }: { dialog: any }) {
107107
}
108108
return <ColumnsGrid columns={dialog.columns ?? 2}>
109109
{dialogs.map((d: any) => {
110-
let text = Identifier.parse(d).path.replaceAll('/', ' ').replaceAll('_', ' ')
111-
text = text.charAt(0).toUpperCase() + text.substring(1)
110+
let text = ''
111+
if (typeof d === 'string') {
112+
text = Identifier.parse(d).path.replaceAll('/', ' ').replaceAll('_', ' ')
113+
text = text.charAt(0).toUpperCase() + text.substring(1)
114+
} else {
115+
text = d?.external_title ?? d?.title ?? ''
116+
}
112117
return <Button label={text} width={dialog.button_width ?? 150} />
113118
})}
114119
</ColumnsGrid>

0 commit comments

Comments
 (0)