Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store notifications on every add, delete #1308

Merged
merged 2 commits into from Jan 11, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -37,7 +37,6 @@ RewardsNotificationServiceImpl::RewardsNotificationServiceImpl(Profile* profile)
}

RewardsNotificationServiceImpl::~RewardsNotificationServiceImpl() {
StoreRewardsNotifications();
#if BUILDFLAG(ENABLE_EXTENSIONS)
RemoveObserver(extension_rewards_notification_service_observer_.get());
#endif
@@ -53,6 +52,7 @@ void RewardsNotificationServiceImpl::AddNotification(
RewardsNotification rewards_notification(
id, type, GenerateRewardsNotificationTimestamp(), std::move(args));
rewards_notifications_[id] = rewards_notification;
StoreRewardsNotifications();
OnNotificationAdded(rewards_notification);
}

@@ -62,11 +62,13 @@ void RewardsNotificationServiceImpl::DeleteNotification(RewardsNotificationID id
return;
RewardsNotification rewards_notification = rewards_notifications_[id];
rewards_notifications_.erase(id);
StoreRewardsNotifications();
OnNotificationDeleted(rewards_notification);
}

void RewardsNotificationServiceImpl::DeleteAllNotifications() {
rewards_notifications_.clear();
StoreRewardsNotifications();
OnAllNotificationsDeleted();
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.