From 725ef45d9dd513dd2a5cd0daf1baebdf90d360cf Mon Sep 17 00:00:00 2001 From: mplorentz Date: Thu, 20 Aug 2026 11:51:26 -0400 Subject: [PATCH] Fix signer error --- src/app/mail/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/app/mail/index.ts b/src/app/mail/index.ts index 291c5023..849c1a83 100644 --- a/src/app/mail/index.ts +++ b/src/app/mail/index.ts @@ -12,9 +12,8 @@ export class MailNotifications { _controller = maybe() async register(email: string, frequency: string) { - const $app = app.get() - const $pubkey = User.require($app).pubkey - const $signer = $app.signer + const $user = User.require(app.get()) + const $signer = $user.signer if (!$signer) throw new Error("No signer available") @@ -23,7 +22,7 @@ export class MailNotifications { const res = await fetch(buildUrl(EMAIL_NOTIFICATION_SERVER, "subscription", "email"), { method: "POST", - body: JSON.stringify({email, frequency, pubkey: $pubkey}), + body: JSON.stringify({email, frequency, pubkey: $user.pubkey}), headers: {Authorization: authHeader, "Content-Type": "application/json"}, }) @@ -37,8 +36,7 @@ export class MailNotifications { const {key} = emailNotificationState.get() if (!key) return - const $app = app.get() - const $signer = $app.signer + const $signer = app.get().user?.signer if (!$signer) return try {