wip: Send dm on sigit sign/complete #230
@ -744,6 +744,12 @@ export const SignPage = () => {
|
|||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (areSent.some((r) => r)) {
|
||||||
|
toast.success(
|
||||||
|
`DMs sent ${areSent.filter((r) => r).length}/${users.length}`
|
||||||
|
)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Notify the creator and the next signer (/sign).
|
// Notify the creator and the next signer (/sign).
|
||||||
try {
|
try {
|
||||||
@ -758,9 +764,11 @@ export const SignPage = () => {
|
|||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
// No need to notify creator twice, skipping
|
||||||
const currentSignerIndex = signers.indexOf(usersNpub)
|
const currentSignerIndex = signers.indexOf(usersNpub)
|
||||||
const nextSigner = signers[currentSignerIndex + 1]
|
const nextSigner = signers[currentSignerIndex + 1]
|
||||||
|
if (nextSigner !== submittedBy) {
|
||||||
|
try {
|
||||||
await sendPrivateDirectMessage(
|
await sendPrivateDirectMessage(
|
||||||
`You're the next signer, visit ${window.location.origin}/#/sign/${id}`,
|
`You're the next signer, visit ${window.location.origin}/#/sign/${id}`,
|
||||||
npubToHex(nextSigner)!
|
npubToHex(nextSigner)!
|
||||||
@ -772,6 +780,7 @@ export const SignPage = () => {
|
|||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user