From 851ba66cdd50aae8e2f9cb70fbed016990df2a2a Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Wed, 7 Dec 2016 14:34:15 -0800 Subject: 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. --- app/scripts/metamask-controller.js | 40 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'app/scripts') diff --git a/app/scripts/metamask-controller.js b/app/scripts/metamask-controller.js index 65619af82..65eda7342 100644 --- a/app/scripts/metamask-controller.js +++ b/app/scripts/metamask-controller.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 -- cgit v1.2.3