From e8820d7c29948e34125c3b2b0e45f15c1dbbfc7c Mon Sep 17 00:00:00 2001 From: fsociety Date: Wed, 2 Oct 2024 14:26:49 +0200 Subject: [PATCH] feat: add environment-specific relayUrl configuration in nostrZap.js --- resources/js/nostrZap.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/js/nostrZap.js b/resources/js/nostrZap.js index 859c665..7923a2a 100644 --- a/resources/js/nostrZap.js +++ b/resources/js/nostrZap.js @@ -8,7 +8,18 @@ export default (livewireComponent) => ({ invoice: livewireComponent.entangle('invoice', true), async zap(message, sender, amountToPay, env) { - const relayUrl = env === 'production' ? 'wss://simple-relay.steuernsindraub21.xyz' : 'wss://simple-relay.steuernsindraub21.xyz'; + const config = { + production: { + relayUrl: 'wss://simple-relay.steuernsindraub21.xyz', + }, + staging: { + relayUrl: 'wss://simple-test-relay.steuernsindraub21.xyz', + }, + local: { + relayUrl: 'ws://simple-test-relay.steuernsindraub21.xyz', + }, + }; + const relayUrl = config[env]?.relayUrl || config['local'].relayUrl; const ndk = new NDK({ explicitRelayUrls: [