Is it possible to suppress a notification popup

I have a notification that is sent to another user. Something like this

$notification = Notification::make()
    ->title(__('New message'))
    ->body($message->content)
    ->actions([
        NotificationAction::make('view')
            ->button()
            ->url('some_url'),
    ]);

    $notification->sendToDatabase($recipient);

    $notification->broadcast($recipient);

    event(new DatabaseNotificationsSent($recipient));

However, if the $recipient is already at some_url, I don't want them to actually show the popup.

Is there a way to check in the client if the current user is in that page and suppress the notification?

What I mean is, if I'm the recipient, can I prevent the notification somehow? (I obviously can't know at the time the notification is sent, only when it's received)

Hope this makes sense. Any ideas welcome
Was this page helpful?