mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2025-12-14 06:36:46 +00:00
feat: add dynamic relay url based on environment
This commit is contained in:
@@ -7,9 +7,13 @@ export default (livewireComponent) => ({
|
|||||||
|
|
||||||
invoice: livewireComponent.entangle('invoice', true),
|
invoice: livewireComponent.entangle('invoice', true),
|
||||||
|
|
||||||
async zap(message, sender, amountToPay) {
|
async zap(message, sender, amountToPay, env) {
|
||||||
|
const relayUrl = env === 'production' ? 'wss://nostr.einundzwanzig.space' : 'wss://simple-relay.steuernsindraub21.xyz';
|
||||||
|
|
||||||
const ndk = new NDK({
|
const ndk = new NDK({
|
||||||
explicitRelayUrls: ['wss://simple-relay.steuernsindraub21.xyz'],
|
explicitRelayUrls: [
|
||||||
|
relayUrl
|
||||||
|
],
|
||||||
enableOutboxModel: false,
|
enableOutboxModel: false,
|
||||||
});
|
});
|
||||||
// Now connect to specified relays
|
// Now connect to specified relays
|
||||||
@@ -27,7 +31,7 @@ export default (livewireComponent) => ({
|
|||||||
profile: sender,
|
profile: sender,
|
||||||
event: event.id,
|
event: event.id,
|
||||||
amount: amount,
|
amount: amount,
|
||||||
relays: ['wss://simple-relay.steuernsindraub21.xyz'],
|
relays: [relayUrl],
|
||||||
comment: message,
|
comment: message,
|
||||||
});
|
});
|
||||||
console.log('zapEvent', zapEvent);
|
console.log('zapEvent', zapEvent);
|
||||||
|
|||||||
@@ -469,7 +469,7 @@ $loadEvents = function () {
|
|||||||
@if(!$invoice && !$currentYearIsPaid)
|
@if(!$invoice && !$currentYearIsPaid)
|
||||||
<div class="flex justify-center">
|
<div class="flex justify-center">
|
||||||
<button
|
<button
|
||||||
@click="zap('{{ date('Y') }}', '{{ $currentPubkey }}', {{ $amountToPay }})"
|
@click="zap('{{ date('Y') }}', '{{ $currentPubkey }}', {{ $amountToPay }}, '{{ config('app.env') }}')"
|
||||||
class="btn text-2xl dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-green-500"
|
class="btn text-2xl dark:bg-gray-800 border-gray-200 dark:border-gray-700/60 hover:border-gray-300 dark:hover:border-gray-600 text-green-500"
|
||||||
>
|
>
|
||||||
<i class="fa-sharp-duotone fa-solid fa-bolt-lightning mr-2"></i>
|
<i class="fa-sharp-duotone fa-solid fa-bolt-lightning mr-2"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user