mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
[ticket/17333] Add push subscribe toggle to notification dropdown
PHPBB-17333 Signed-off-by: Matt Friedman <maf675@gmail.com>
This commit is contained in:
@@ -26,13 +26,14 @@ class add_webpush_options extends migration
|
||||
|
||||
public function effectively_installed(): bool
|
||||
{
|
||||
return $this->config->offsetExists('webpush_method_enables');
|
||||
return $this->config->offsetExists('webpush_method_enables') || $this->config->offsetExists('webpush_dropdown_subscribe');
|
||||
}
|
||||
|
||||
public function update_data(): array
|
||||
{
|
||||
return [
|
||||
['config.add', ['webpush_method_enables', false]],
|
||||
['config.add', ['webpush_dropdown_subscribe', false]],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ class add_webpush_options extends migration
|
||||
{
|
||||
return [
|
||||
['config.remove', ['webpush_method_enables']],
|
||||
['config.remove', ['webpush_dropdown_subscribe']],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@@ -355,7 +355,7 @@ class webpush extends messenger_base implements extended_method_interface
|
||||
}
|
||||
|
||||
return [
|
||||
'NOTIFICATIONS_WEBPUSH_ENABLE' => true,
|
||||
'NOTIFICATIONS_WEBPUSH_ENABLE' => $this->config['webpush_dropdown_subscribe'] || stripos($this->user->page['page'], 'notification_options'),
|
||||
'U_WEBPUSH_SUBSCRIBE' => $controller_helper->route('phpbb_ucp_push_subscribe_controller'),
|
||||
'U_WEBPUSH_UNSUBSCRIBE' => $controller_helper->route('phpbb_ucp_push_unsubscribe_controller'),
|
||||
'VAPID_PUBLIC_KEY' => $this->config['webpush_vapid_public'],
|
||||
|
Reference in New Issue
Block a user