Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
To the Review sites notification add a Dismiss button
Browse files Browse the repository at this point in the history
Because you should always be able to dismiss a notification.

Auditors: @bsclifton

Test Plan:
(Similar to plan for #5296)

1. Trigger the "Payment in 24 hours, please review" notification.
  a. Update reconcileStamp to <24 hours from now
  b. Have sufficient funds; OR disable the sufficient funds conditional by adding false to ledger.js L1485 (showEnabledNotifications())
  c. Change startup notification delay in ledger.js L484 from 15m to 5s
2. Open Brave and observe 24h review notification
3. Close Brave and reopen. Notification should not reappear.
(Next 24h notification timestamp is set in Application Support/brave-development/session-store-1)
  • Loading branch information
ayumi committed Nov 7, 2016
1 parent 545b066 commit 7e8f145
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/extensions/brave/locales/en-US/app.properties
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ flashExpirationText=Approvals reset 7 days after last visit.
addFundsNotification=Your Brave Payments account is waiting for a deposit.
reconciliationNotification=Good news! Brave will pay your favorite publisher sites in less than 24 hours.
reviewSites=Review your chosen sites
dismiss=Dismiss
addFunds=Add funds
notificationPasswordWithUserName=Would you like Brave to remember the password for {{username}} on {{origin}}?
notificationPassword=Would you like Brave to remember your password on {{origin}}?
Expand Down
6 changes: 4 additions & 2 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ if (ipc) {
}
} else if (message === reconciliationMessage) {
appActions.hideMessageBox(message)
if (win) {
// buttonIndex === 1 is Dismiss
if (buttonIndex === 0 && win) {
win.webContents.send(messages.SHORTCUT_NEW_FRAME,
'about:preferences#payments', { singleFrame: true })
}
Expand Down Expand Up @@ -1532,7 +1533,8 @@ const showNotificationReviewPublishers = () => {
greeting: locale.translation('updateHello'),
message: reconciliationMessage,
buttons: [
{text: locale.translation('reviewSites'), className: 'primary'}
{text: locale.translation('reviewSites'), className: 'primary'},
{text: locale.translation('dismiss')}
],
options: {
style: 'greetingStyle',
Expand Down
1 change: 1 addition & 0 deletions app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ var rendererIdentifiers = function () {
'notificationTryPayments',
'notificationTryPaymentsYes',
'prefsRestart',
'dismiss',
'yes',
'no',
'noThanks',
Expand Down

0 comments on commit 7e8f145

Please sign in to comment.