Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions resources/views/livewire/settings/notifications.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ class="btn btn-ghost btn-sm">
@endif

@if ($channel->is_active && $channel->isConfigured())
<div x-data="{ sent: false }"
<div x-data="{ sent: false, sending: false }"
x-on:notifications-test-sent.window="if ($event.detail.channelId === {{ $channel->id }}) { sent = true; setTimeout(() => sent = false, 2500); }"
class="flex items-center gap-2">
<span x-show="sent" x-transition.opacity class="text-sm text-success" style="display:none">
{{ __('Test queued') }}
</span>
<button type="button"
wire:click="sendTest({{ $channel->id }})"
wire:loading.attr="disabled"
wire:target="sendTest({{ $channel->id }})"
x-on:click="sending = true; $wire.sendTest({{ $channel->id }}).finally(() => sending = false)"
x-bind:disabled="sending"
class="btn btn-outline btn-sm">
<span wire:loading.remove wire:target="sendTest({{ $channel->id }})">{{ __('Send test') }}</span>
<span wire:loading wire:target="sendTest({{ $channel->id }})">{{ __('Sending…') }}</span>
<span x-show="! sending">{{ __('Send test') }}</span>
<span x-show="sending" style="display:none">{{ __('Sending…') }}</span>
</button>
</div>
@endif
Expand Down
Loading