Add ability to show notices to user & get confirmation.

Implement generation of markdown for notice files.
Create npm command. Enhance notice generation.
Add test files to test multiple notices.
Add basic markdown support to notices.
Interval checks for updates.
Add extensionizer and linker
Add terms and conditions state file
Add link support to disclaimer.
Changelog addition.
feature/default_network_editable
Kevin Serrano 8 years ago committed by Dan Finlay
parent 8819475a2e
commit 851ba66cdd
  1. 40
      app/scripts/metamask-controller.js
  2. 1
      development/states.js
  3. 2
      ui/app/actions.js
  4. 4
      ui/app/app.js

@ -21,6 +21,9 @@ module.exports = class MetamaskController {
this.noticeController = new NoticeController({
configManager: this.configManager,
})
this.noticeController = new NoticeController({
configManager: this.configManager,
})
this.provider = this.initializeProvider(opts)
this.ethStore = new EthStore(this.provider)
this.idStore.setStore(this.ethStore)
@ -298,14 +301,6 @@ module.exports = class MetamaskController {
}
checkNotices () {
try {
this.configManager.updateNoticesList()
} catch (e) {
console.error('Error in checking notices.')
}
}
// notice
markNoticeRead (notice, cb) {
@ -317,6 +312,25 @@ module.exports = class MetamaskController {
}
}
checkNotices () {
try {
this.configManager.updateNoticesList()
} catch (e) {
console.error('Error in checking notices.')
}
}
scheduleNoticeCheck () {
if (this.noticeCheck) {
clearInterval(this.noticeCheck)
}
this.noticeCheck = setInterval(() => {
this.configManager.updateNoticesList()
}, 300000)
}
// disclaimer
agreeToDisclaimer (cb) {
try {
this.configManager.setConfirmed(true)
@ -359,7 +373,6 @@ module.exports = class MetamaskController {
}, 300000)
}
<<<<<<< HEAD
agreeToEthWarning (cb) {
try {
this.configManager.setShouldntShowWarning()
@ -367,15 +380,6 @@ module.exports = class MetamaskController {
} catch (e) {
cb(e)
}
=======
scheduleNoticeCheck () {
if (this.noticeCheck) {
clearInterval(this.noticeCheck)
}
this.noticeCheck = setInterval(() => {
this.configManager.updateNoticesList()
}, 300000)
>>>>>>> 25acad7... Add ability to show notices to user & get confirmation.
}
// called from popup

File diff suppressed because one or more lines are too long

@ -533,7 +533,7 @@ function goBackToInitView () {
function markNoticeRead (notice) {
return (dispatch) => {
dispatch(this.showLoadingIndication())
background.markNoticeRead(notice, (err, notice) => {
_accountManager.markNoticeRead(notice, (err, notice) => {
dispatch(this.hideLoadingIndication())
if (err) {
return dispatch(actions.showWarning(err))

@ -432,6 +432,10 @@ App.prototype.renderPrimary = function () {
return h(NoticeScreen, {key: 'NoticeScreen'})
}
if (!props.noActiveNotices) {
return h(NoticeScreen, {key: 'NoticeScreen'})
}
// show current view
switch (props.currentView.name) {
case 'EthStoreWarning':

Loading…
Cancel
Save