From 14379acbd38444c2881448ea1ad5f1613df4d852 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sat, 4 Mar 2023 17:49:24 +0100 Subject: [PATCH] Fix incorrect access of `unread_inbox_count` in `notification_data` --- app/models/user/push_notification_methods.rb | 2 +- spec/workers/question_worker_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user/push_notification_methods.rb b/app/models/user/push_notification_methods.rb index fd8eae03..b7b8f5d9 100644 --- a/app/models/user/push_notification_methods.rb +++ b/app/models/user/push_notification_methods.rb @@ -19,7 +19,7 @@ module User::PushNotificationMethods def notification_data = { data: { - badge: current_user.unread_inbox_count, + badge: unread_inbox_count, }, } end diff --git a/spec/workers/question_worker_spec.rb b/spec/workers/question_worker_spec.rb index 8070392b..0795e55b 100644 --- a/spec/workers/question_worker_spec.rb +++ b/spec/workers/question_worker_spec.rb @@ -78,7 +78,7 @@ describe QuestionWorker do user: receiver, subscription: { endpoint: "This will not be used", - keys: {} + keys: {}, } ) receiver.follow(user)