1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

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.
This commit is contained in:
Kevin Serrano 2016-12-07 14:34:15 -08:00 committed by Dan Finlay
parent 8819475a2e
commit 851ba66cdd
4 changed files with 27 additions and 20 deletions

View File

@ -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

View File

@ -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))

View File

@ -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':