From e55938ed15428b452224f2d731c1e7ad141869d4 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 18:22:16 -0700 Subject: First simple version of ui mocker --- ui/app/info.js | 2 +- ui/app/reducers.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/info.js b/ui/app/info.js index a473f5921..720b62d33 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -17,7 +17,7 @@ function InfoScreen () { InfoScreen.prototype.render = function () { var state = this.props - var manifest = chrome.runtime.getManifest() + var manifest = chrome ? chrome.runtime.getManifest() : { version: '2.0.0' } return ( h('.flex-column.flex-grow', [ diff --git a/ui/app/reducers.js b/ui/app/reducers.js index 17f94f230..f198758ea 100644 --- a/ui/app/reducers.js +++ b/ui/app/reducers.js @@ -13,6 +13,10 @@ function rootReducer (state, action) { // clone state = extend(state) + if (action.type === 'GLOBAL_FORCE_UPDATE') { + return action.value + } + // // Identities // -- cgit From 2843459fcf8bb74fba29b2ff884bf1daa7a708d2 Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 30 Jun 2016 18:23:05 -0700 Subject: Make info page not chrome dependent --- ui/app/info.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/app/info.js b/ui/app/info.js index 720b62d33..d97998fd7 100644 --- a/ui/app/info.js +++ b/ui/app/info.js @@ -17,7 +17,13 @@ function InfoScreen () { InfoScreen.prototype.render = function () { var state = this.props - var manifest = chrome ? chrome.runtime.getManifest() : { version: '2.0.0' } + var manifest + try { + manifest = chrome.runtime.getManifest() + } catch (e) { + manifest = { version: '2.0.0' } + } + return ( h('.flex-column.flex-grow', [ -- cgit