Skip to content

Commit 07aaf84

Browse files
authored
Fix: Apprise test button shown without saving (alexjustesen#2627)
1 parent 0e405e3 commit 07aaf84

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/Filament/Pages/Settings/Notification.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public function form(Schema $schema): Schema
257257
]),
258258
Repeater::make('apprise_channel_urls')
259259
->label(__('settings/notifications.apprise_channels'))
260+
->helperText(__('settings/notifications.apprise_save_to_test'))
260261
->schema([
261262
TextInput::make('channel_url')
262263
->label(__('settings/notifications.apprise_channel_url'))
@@ -274,7 +275,11 @@ public function form(Schema $schema): Schema
274275
->action(fn (Get $get) => SendAppriseTestNotification::run(
275276
channel_urls: $get('apprise_channel_urls'),
276277
))
277-
->hidden(fn (Get $get) => ! count($get('apprise_channel_urls'))),
278+
->hidden(function () {
279+
$settings = app(NotificationSettings::class);
280+
281+
return empty($settings->apprise_server_url) || ! count($settings->apprise_channel_urls ?? []);
282+
}),
278283
]),
279284
]),
280285
]),

lang/en/settings/notifications.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'apprise_channel_url' => 'Service URL',
2626
'apprise_hint_description' => 'Apprise allows you to send notifications to 90+ services. You need to run an Apprise server and configure service URLs below.',
2727
'apprise_channel_url_helper' => 'Use Apprise URL format. Examples: discord://WebhookID/Token, slack://TokenA/TokenB/TokenC',
28+
'apprise_save_to_test' => 'Save your settings to test the notification.',
2829
'test_apprise_channel' => 'Test Apprise',
2930
'apprise_channel_url_validation_error' => 'Invalid Apprise URL. Must use Apprise format (e.g., discord://, slack://), not http:// or https://. See the Apprise documentation for more information',
3031

0 commit comments

Comments
 (0)