Skip to content

Commit f676cf8

Browse files
committed
trim prop forwarding and locale lookups
1 parent d6f7da4 commit f676cf8

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/components/DropdownIcon/DropdownIcon.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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",

src/components/Select/Select.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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,

src/i18n/services/locale.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff 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) {

supabase/functions/send-email-for-newsletter-issue-resend-audience/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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) {

0 commit comments

Comments
 (0)