Skip to content

Commit

Permalink
check for empty job connection
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Dec 1, 2024
1 parent ed91edd commit bec9bac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/actions/src/Concerns/CanExportRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,10 @@ protected function setUp(): void
)
->dispatch();

if (($jobConnection !== 'sync') || (blank($jobConnection) && (config('queue.default') !== 'sync'))) {
if (
(filled($jobConnection) && ($jobConnection !== 'sync')) ||
(blank($jobConnection) && (config('queue.default') !== 'sync'))
) {
Notification::make()
->title($action->getSuccessNotificationTitle())
->body(trans_choice('filament-actions::export.notifications.started.body', $export->total_rows, [
Expand Down
8 changes: 6 additions & 2 deletions packages/actions/src/Concerns/CanImportRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ protected function setUp(): void
]),
)
->when(
($jobConnection === 'sync') || (blank($jobConnection) && (config('queue.default') === 'sync')),
(filled($jobConnection) && ($jobConnection === 'sync')) ||
(blank($jobConnection) && (config('queue.default') === 'sync')),
fn (Notification $notification) => $notification
->persistent()
->send(),
Expand All @@ -317,7 +318,10 @@ protected function setUp(): void
})
->dispatch();

if (($jobConnection !== 'sync') || (blank($jobConnection) && (config('queue.default') !== 'sync'))) {
if (
(filled($jobConnection) && ($jobConnection !== 'sync')) ||
(blank($jobConnection) && (config('queue.default') !== 'sync'))
) {
Notification::make()
->title($action->getSuccessNotificationTitle())
->body(trans_choice('filament-actions::import.notifications.started.body', $import->total_rows, [
Expand Down
3 changes: 2 additions & 1 deletion packages/actions/src/Exports/Jobs/ExportCompletion.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function handle(): void
)),
)
->when(
($this->connection === 'sync') || (blank($this->connection) && (config('queue.default') === 'sync')),
(filled($this->connection) && ($this->connection === 'sync')) ||
(blank($this->connection) && (config('queue.default') === 'sync')),
fn (Notification $notification) => $notification
->persistent()
->send(),
Expand Down

0 comments on commit bec9bac

Please sign in to comment.