File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -760,7 +760,7 @@ export function normalizeButtonMessage(
760
760
}
761
761
}
762
762
763
- if ( offer ) {
763
+ if ( offer || typeof offer === "string" ) {
764
764
if ( ! Array . isArray ( offer ) ) {
765
765
throw new TypeError (
766
766
`Expected message.offer to be an array of strings, got: ${ String (
@@ -776,15 +776,18 @@ export function normalizeButtonMessage(
776
776
}
777
777
}
778
778
779
- if ( color && ! values ( MESSAGE_COLOR ) . includes ( color ) ) {
779
+ if ( color === "" || ( color && ! values ( MESSAGE_COLOR ) . includes ( color ) ) ) {
780
780
throw new Error ( `Invalid color: ${ color } ` ) ;
781
781
}
782
782
783
- if ( position && ! values ( MESSAGE_POSITION ) . includes ( position ) ) {
783
+ if (
784
+ position === "" ||
785
+ ( position && ! values ( MESSAGE_POSITION ) . includes ( position ) )
786
+ ) {
784
787
throw new Error ( `Invalid position: ${ position } ` ) ;
785
788
}
786
789
787
- if ( align && ! values ( MESSAGE_ALIGN ) . includes ( align ) ) {
790
+ if ( align === "" || ( align && ! values ( MESSAGE_ALIGN ) . includes ( align ) ) ) {
788
791
throw new Error ( `Invalid align: ${ align } ` ) ;
789
792
}
790
793
You can’t perform that action at this time.
0 commit comments