Skip to content

Commit

Permalink
update for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepollak committed Mar 12, 2016
1 parent 57b53fd commit b34d5dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/Container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let Icon = (props) => {
}

let Version = (props) => {
if (!Extension.isExtension()) return <span />
return (
<a className={styles.version} href="https://github.com/jessepollak/command/releases" target="_blank">
Private beta v{ Extension.getVersion() }
Expand Down
7 changes: 6 additions & 1 deletion src/lib/extension.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export function isExtension() {
return !!(window.chrome && window.chrome.runtime && window.chrome.runtime.getManifest)
}
export function getVersion() {
return chrome.runtime.getManifest().version
if (isExtension()) {
return chrome.runtime.getManifest().version
}
}

0 comments on commit b34d5dd

Please sign in to comment.