File tree Expand file tree Collapse file tree
supabase/functions/send-email-for-newsletter-issue-resend-audience Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import { styled } from "@pigment-css/react";
33
44// See ChevronRightIcon too, which was a fork of this (and more basic primitive)
55// In fact, perhaps this should have a ChevronDownIcon embedded
6- const StyledIconWrapper = styled ( IconWrapper ) ( ( { theme } ) => ( {
6+ const StyledIconWrapper = styled ( IconWrapper , {
7+ shouldForwardProp : ( prop ) => prop !== "variant" ,
8+ } ) ( ( { theme } ) => ( {
79 pointerEvents : "none" ,
810 position : "absolute" ,
911 right : "0.75rem" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,9 @@ const SilentContainer = styled("div")(({ theme }) => ({
77 position : "relative" ,
88} ) ) ;
99
10- const StyledSelect = styled ( HeadlessSelect ) ( ( { theme } ) => ( {
10+ const StyledSelect = styled ( HeadlessSelect , {
11+ shouldForwardProp : ( prop ) => prop !== "variant" ,
12+ } ) ( ( { theme } ) => ( {
1113 width : "100%" ,
1214 appearance : "none" , // Reset browser-specific styles
1315 color : theme . colors . text . ui . primary ,
Original file line number Diff line number Diff line change @@ -38,6 +38,15 @@ export async function getUserLocale() {
3838 } = await supabase . auth . getUser ( ) ;
3939
4040 if ( user ?. id ) {
41+ const metadataLocale = normaliseLocale (
42+ typeof user . user_metadata ?. preferred_locale === "string"
43+ ? user . user_metadata . preferred_locale
44+ : null
45+ ) ;
46+ if ( metadataLocale ) {
47+ return metadataLocale ;
48+ }
49+
4150 const { data : profile , error : profileError } = await supabase
4251 . from ( "profiles" )
4352 . select ( "preferred_locale" )
@@ -55,15 +64,6 @@ export async function getUserLocale() {
5564 if ( profileLocale ) {
5665 return profileLocale ;
5766 }
58-
59- const metadataLocale = normaliseLocale (
60- typeof user . user_metadata ?. preferred_locale === "string"
61- ? user . user_metadata . preferred_locale
62- : null
63- ) ;
64- if ( metadataLocale ) {
65- return metadataLocale ;
66- }
6767 }
6868
6969 if ( acceptedLocales . length > 0 ) {
Original file line number Diff line number Diff line change @@ -26,10 +26,6 @@ const handler = async (_request: Request): Promise<Response> => {
2626
2727 const audienceConfigs = getNewsletterAudienceConfigs ( ) ;
2828
29- if ( audienceConfigs . length === 0 ) {
30- throw new Error ( "No newsletter audiences configured" ) ;
31- }
32-
3329 const broadcasts = [ ] ;
3430
3531 for ( const { locale, audienceId } of audienceConfigs ) {
You can’t perform that action at this time.
0 commit comments