Skip to content

Commit 5ba1611

Browse files
committed
fix(notifications): respect pauseViews preference for authenticated first-view email
1 parent 4305c6a commit 5ba1611

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/web/lib/Notification.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,11 @@ export async function sendFirstViewEmail(
341341
if (!params.isAnonymous && params.viewerUserId === videoWithOwner.ownerId)
342342
return;
343343

344+
const preferences = videoWithOwner.preferences as UserPreferences;
344345
if (params.isAnonymous) {
345-
const preferences = videoWithOwner.preferences as UserPreferences;
346346
if (preferences?.notifications?.pauseAnonViews) return;
347+
} else {
348+
if (preferences?.notifications?.pauseViews) return;
347349
}
348350

349351
const [result] = await database

0 commit comments

Comments
 (0)