Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@ public function __construct(controller_helper $controller_helper, form_helper $f
public function load_template_data()
{
$methods = $this->phpbb_notifications->get_subscription_methods();
if (array_key_exists('notification.method.phpbb.wpn.webpush', $methods))
$webpush_method = $methods['notification.method.phpbb.wpn.webpush'] ?? null;

if ($webpush_method !== null)
{
if (!$this->language->is_set('NOTIFICATION_METHOD_PHPBB_WPN_WEBPUSH'))
{
$this->language->add_lang('webpushnotifications_module_ucp', 'phpbb/webpushnotifications');
}
$template_ary = $methods['notification.method.phpbb.wpn.webpush']['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);

$template_ary = $webpush_method['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
$this->template->assign_vars($template_ary);
}
}
Expand Down
4 changes: 2 additions & 2 deletions notification/method/webpush.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function is_available(type_interface $notification_type = null): bool
*/
public function is_enabled_by_default()
{
return $this->config['wpn_webpush_method_enabled'];
return (bool) $this->config['wpn_webpush_method_enabled'];
}

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

$number_of_notifications = 0;
Expand Down
2 changes: 1 addition & 1 deletion styles/all/theme/phpbb_wpn.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
padding: 5px 25px;
padding: 5px 10px;
}

.wpn-notification-dropdown-footer button:disabled {
Expand Down