mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
refactor: add relay of conf.relay in case no relays are present
This commit is contained in:
parent
feff31f094
commit
06ac326ec3
1 changed files with 5 additions and 1 deletions
|
|
@ -170,7 +170,7 @@ const createWalletSchema = z.object({
|
|||
* https://github.com/nostr-protocol/nips/blob/master/61.md#nutzap-informational-event
|
||||
*/
|
||||
route.put('/wallet', userMiddleware({ enc: 'nip44' }), async (c) => {
|
||||
const { user, relay, signal } = c.var;
|
||||
const { user, relay, signal, conf } = c.var;
|
||||
|
||||
const pubkey = await user.signer.getPublicKey();
|
||||
const body = await parseBody(c.req.raw);
|
||||
|
|
@ -209,6 +209,10 @@ route.put('/wallet', userMiddleware({ enc: 'nip44' }), async (c) => {
|
|||
walletContentTags.push(['mint', mint]);
|
||||
}
|
||||
|
||||
if (relays.length < 1) {
|
||||
relays.push(conf.relay);
|
||||
}
|
||||
|
||||
const encryptedWalletContentTags = await user.signer.nip44.encrypt(pubkey, JSON.stringify(walletContentTags));
|
||||
|
||||
// Wallet
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue