diff --git a/components/brave_rewards/browser/rewards_notification_service_impl.cc b/components/brave_rewards/browser/rewards_notification_service_impl.cc index e6e530fe74e9..3e951d3bea5e 100644 --- a/components/brave_rewards/browser/rewards_notification_service_impl.cc +++ b/components/brave_rewards/browser/rewards_notification_service_impl.cc @@ -21,11 +21,9 @@ namespace brave_rewards { RewardsNotificationServiceImpl::RewardsNotificationServiceImpl(Profile* profile) : profile_(profile) { - ReadRewardsNotifications(); } RewardsNotificationServiceImpl::~RewardsNotificationServiceImpl() { - StoreRewardsNotifications(); } void RewardsNotificationServiceImpl::AddNotification( @@ -102,16 +100,18 @@ void RewardsNotificationServiceImpl::ReadRewardsNotifications() { int notification_timestamp; RewardsNotificationArgs notification_args; dict_value->GetString("id", ¬ification_id); + dict_value->GetInteger("type", ¬ification_type); + dict_value->GetInteger("timestamp", ¬ification_timestamp); if (notification_id.empty()) { int old_id; dict_value->GetInteger("id", &old_id); - notification_id = std::to_string(old_id); + if (old_id == 0 && notification_type == 2) + notification_id = "rewards_notification_grant"; + else + notification_id = std::to_string(old_id); } - dict_value->GetInteger("type", ¬ification_type); - dict_value->GetInteger("timestamp", ¬ification_timestamp); - base::ListValue* args; dict_value->GetList("args", &args); for (auto& arg : *args) {