Skip to content

Commit

Permalink
Fix in app notification
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 2, 2024
1 parent 193e11a commit d1592e8
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 42 deletions.
6 changes: 3 additions & 3 deletions apps/dashboard/jobs/utils/transaction-notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export async function handleTransactionNotifications(
to: transactions[transactions.length - 1]?.date,
description: t("notifications.transactions", {
numberOfTransactions: transactions.length,
// For single transaction
amount: transactions[0]?.amount,
name: transactions[0]?.name,
}),
// For single transaction
amount: transactions[0]?.amount,
name: transactions[0]?.name,
},
user: {
subscriberId: user.id,
Expand Down
35 changes: 0 additions & 35 deletions apps/dashboard/src/components/notification-center.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,41 +68,6 @@ function NotificationItem({
</div>
);

case "transaction":
return (
<div className="flex items-between justify-between space-x-4 px-3 py-3 hover:bg-secondary">
<Link
className="flex items-between justify-between space-x-4 "
onClick={() => setOpen(false)}
href={`/transactions?id=${recordId}`}
>
<div>
<div className="h-9 w-9 flex items-center justify-center space-y-0 border rounded-full">
<Icons.Transactions />
</div>
</div>
<div>
<p className="text-sm">{description}</p>
<span className="text-xs text-[#606060]">
{formatDistanceToNow(new Date(createdAt))} ago
</span>
</div>
</Link>
{markMessageAsRead && (
<div>
<Button
size="icon"
variant="secondary"
className="rounded-full bg-transparent hover:bg-[#1A1A1A]"
onClick={() => markMessageAsRead(id)}
>
<Icons.Inventory2 />
</Button>
</div>
)}
</div>
);

case "inbox":
return (
<div className="flex items-between justify-between space-x-4 px-3 py-3 hover:bg-secondary">
Expand Down
2 changes: 0 additions & 2 deletions packages/email/locales/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export function translations(locale: string, params?: TranslationParams) {
case "en":
return {
"notifications.match": `We matched the transaction “${params?.transactionName}” against “${params?.fileName}”`,
"notifications.transaction": `You have a new transaction of ${params?.amount} from ${params?.from}`,
"notifications.transactions":
params?.numberOfTransactions &&
typeof params?.numberOfTransactions === "number" &&
Expand Down Expand Up @@ -62,7 +61,6 @@ export function translations(locale: string, params?: TranslationParams) {
case "sv":
return {
"notifications.match": `Vi matchade transaktionen “${params?.transactionName}” mot “${params?.fileName}”`,
"notifications.transaction": `Du har en ny transaktion på ${params?.amount} från ${params?.from}`,
"notifications.transactions":
params?.numberOfTransactions &&
typeof params?.numberOfTransactions === "number" &&
Expand Down
4 changes: 3 additions & 1 deletion packages/events/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ type Props = {

export const setupAnalytics = async (options?: Props) => {
const { userId, fullName } = options ?? {};
const trackingConsent = cookies().get("tracking-consent")?.value === "0";
const trackingConsent =
!cookies().has("tracking-consent") ||
cookies().get("tracking-consent")?.value === "1";

const client = new OpenPanel({
clientId: process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID!,
Expand Down
2 changes: 1 addition & 1 deletion packages/location/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function getCountryInfo() {
}

export function isEU() {
const countryCode = headers().get("x-vercel-ip-country");
const countryCode = getCountryCode();

if (countryCode && EU_COUNTRY_CODES.includes(countryCode)) {
return true;
Expand Down

0 comments on commit d1592e8

Please sign in to comment.