Skip to content

Commit

Permalink
Adds confirmation dialog upon clicking the trash icon in the ledger t…
Browse files Browse the repository at this point in the history
…able.
  • Loading branch information
ryanml committed Feb 27, 2018
1 parent b0542c8 commit 53a414e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ autoplay=Autoplay Media
autoSuggestSites=auto-include
backupLedger=Backup your wallet
balanceRecovered={{balance}} was recovered and transferred to your Brave wallet.
banSiteConfirmation=Are you sure you want to delete this site?
beta=beta
bitcoin=Bitcoin
bitcoinBalance=Please transfer: 
Expand Down
1 change: 1 addition & 0 deletions app/locale.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ var rendererIdentifiers = function () {
'dappDetected',
'dappDismiss',
'dappEnableExtension',
'banSiteConfirmation',
// other
'passwordsManager',
'extensionsManager',
Expand Down
6 changes: 5 additions & 1 deletion app/renderer/components/preferences/payment/ledgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const getSetting = require('../../../../../js/settings').getSetting
const aboutActions = require('../../../../../js/about/aboutActions')
const urlUtil = require('../../../../../js/lib/urlutil')
const {SettingCheckbox, SiteSettingCheckbox} = require('../../common/settings')
const locale = require('../../../../../js/l10n')

class LedgerTable extends ImmutableComponent {
get synopsis () {
Expand Down Expand Up @@ -100,7 +101,10 @@ class LedgerTable extends ImmutableComponent {
}

banSite (hostPattern) {
aboutActions.changeSiteSetting(hostPattern, 'ledgerPaymentsShown', false)
const confMsg = locale.translation('banSiteConfirmation')
if (window.confirm(confMsg)) {
aboutActions.changeSiteSetting(hostPattern, 'ledgerPaymentsShown', false)
}
}

togglePinSite (hostPattern, pinned, percentage) {
Expand Down

0 comments on commit 53a414e

Please sign in to comment.