From 1474fafde7b76f465d895ef0457960c0704ec444 Mon Sep 17 00:00:00 2001 From: en Date: Fri, 7 Feb 2025 14:49:25 +0100 Subject: [PATCH] fix(dm): don't send private DM twice to same signer --- src/pages/sign/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/sign/index.tsx b/src/pages/sign/index.tsx index e210cb9..a1a3039 100644 --- a/src/pages/sign/index.tsx +++ b/src/pages/sign/index.tsx @@ -633,7 +633,8 @@ export const SignPage = () => { ) } } else { - // Notify the creator and the next signer (/sign). + // Notify the creator and + // the next signer (/sign). try { await sendPrivateDirectMessage( `Sigit signed by ${usersNpub}, visit ${window.location.origin}/#/sign/${id}`, @@ -648,12 +649,12 @@ export const SignPage = () => { // No need to notify creator twice, skipping const currentSignerIndex = signers.indexOf(usersNpub) - const nextSigner = signers[currentSignerIndex + 1] + const nextSigner = npubToHex(signers[currentSignerIndex + 1]) if (nextSigner !== submittedBy) { try { await sendPrivateDirectMessage( `You're the next signer, visit ${window.location.origin}/#/sign/${id}`, - npubToHex(nextSigner)! + nextSigner! ) } catch (error) { if (error instanceof SendDMError) {