Skip to content

Commit 020abbf

Browse files
committed
Merge branch 'main' into Release-1.0.0
2 parents 749daeb + 35266fd commit 020abbf

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

event/listener.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ public function __construct(controller_helper $controller_helper, form_helper $f
7373
public function load_template_data()
7474
{
7575
$methods = $this->phpbb_notifications->get_subscription_methods();
76-
if (array_key_exists('notification.method.phpbb.wpn.webpush', $methods))
76+
$webpush_method = $methods['notification.method.phpbb.wpn.webpush'] ?? null;
77+
78+
if ($webpush_method !== null)
7779
{
7880
if (!$this->language->is_set('NOTIFICATION_METHOD_PHPBB_WPN_WEBPUSH'))
7981
{
8082
$this->language->add_lang('webpushnotifications_module_ucp', 'phpbb/webpushnotifications');
8183
}
82-
$template_ary = $methods['notification.method.phpbb.wpn.webpush']['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
84+
85+
$template_ary = $webpush_method['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
8386
$this->template->assign_vars($template_ary);
8487
}
8588
}

notification/method/webpush.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function is_available(type_interface $notification_type = null): bool
101101
*/
102102
public function is_enabled_by_default()
103103
{
104-
return $this->config['wpn_webpush_method_enabled'];
104+
return (bool) $this->config['wpn_webpush_method_enabled'];
105105
}
106106

107107
/**
@@ -205,7 +205,7 @@ protected function notify_using_webpush(): void
205205
// Fix encryption payload size for Firefox on Android
206206
if (preg_match('/android.*firefox/i', $this->user->browser))
207207
{
208-
$web_push->setAutomaticPadding(2820);
208+
$web_push->setAutomaticPadding(2000);
209209
}
210210

211211
$number_of_notifications = 0;

styles/all/theme/phpbb_wpn.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
display: flex;
1919
flex-wrap: nowrap;
2020
justify-content: space-between;
21-
padding: 5px 25px;
21+
padding: 5px 10px;
2222
}
2323

2424
.wpn-notification-dropdown-footer button:disabled {

0 commit comments

Comments
 (0)