Skip to content

Commit

Permalink
offline modal fix, open subscription window fix, open a links externally
Browse files Browse the repository at this point in the history
  • Loading branch information
danenania committed Sep 25, 2017
1 parent 56178cd commit 12c7ba7
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 28 deletions.
7 changes: 6 additions & 1 deletion envkey-electron/main.js
Expand Up @@ -6,7 +6,7 @@ const
createMenu = require('./main-process/create_menu'),
logger = require("electron-log"),
updater = require('electron-simple-updater'),
{app, BrowserWindow} = electron
{app, BrowserWindow, ipcMain} = electron

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand Down Expand Up @@ -113,4 +113,9 @@ app.on('activate', () => {
} else {
createWindow()
}
})

ipcMain.on("openStripeForm", (e, json)=>{
if(stripeWin)stripeWin.close()
createStripeWindow(json)
})
2 changes: 1 addition & 1 deletion envkey-electron/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion envkey-electron/package.json
@@ -1,6 +1,6 @@
{
"name": "EnvKey",
"version": "1.0.0",
"version": "1.0.1",
"description": "EnvKey's cross-platform native app",
"author": "Dane Schneider <dane@envkey.com> (https://www.envkey.com)",
"homepage": "https://www.envkey.com",
Expand Down
6 changes: 3 additions & 3 deletions envkey-electron/preload.js
@@ -1,5 +1,5 @@
const electron = require("electron"),
{clipboard, remote, ipcRenderer} = electron,
{clipboard, remote, ipcRenderer, shell} = electron,
updater = remote.require("electron-simple-updater")

window.copy = s => {
Expand All @@ -8,5 +8,5 @@ window.copy = s => {
}

window.ipc = ipcRenderer

window.updater = updater
window.updater = updater
window.shell = shell
30 changes: 15 additions & 15 deletions envkey-electron/updates.json
@@ -1,27 +1,27 @@
{
"linux-ia32-prod": {
"update": "https://github.com/envkey/envkey-app/releases/download/linux-ia32-prod-v1.0.0/EnvKey-1.0.0-i386.AppImage",
"install": "https://github.com/envkey/envkey-app/releases/download/linux-ia32-prod-v1.0.0/EnvKey-1.0.0-i386.AppImage",
"version": "1.0.0"
"update": "https://github.com/envkey/envkey-app/releases/download/linux-ia32-prod-v1.0.1/EnvKey-1.0.1-i386.AppImage",
"install": "https://github.com/envkey/envkey-app/releases/download/linux-ia32-prod-v1.0.1/EnvKey-1.0.1-i386.AppImage",
"version": "1.0.1"
},
"linux-x64-prod": {
"update": "https://github.com/envkey/envkey-app/releases/download/linux-x64-prod-v1.0.0/EnvKey-1.0.0-x86_64.AppImage",
"install": "https://github.com/envkey/envkey-app/releases/download/linux-x64-prod-v1.0.0/EnvKey-1.0.0-x86_64.AppImage",
"version": "1.0.0"
"update": "https://github.com/envkey/envkey-app/releases/download/linux-x64-prod-v1.0.1/EnvKey-1.0.1-x86_64.AppImage",
"install": "https://github.com/envkey/envkey-app/releases/download/linux-x64-prod-v1.0.1/EnvKey-1.0.1-x86_64.AppImage",
"version": "1.0.1"
},
"win32-x64-prod": {
"update": "https://github.com/envkey/envkey-app/releases/download/win32-x64-prod-v1.0.0",
"install": "https://github.com/envkey/envkey-app/releases/download/win32-x64-prod-v1.0.0/EnvKey Setup 1.0.0.exe",
"version": "1.0.0"
"update": "https://github.com/envkey/envkey-app/releases/download/win32-x64-prod-v1.0.1",
"install": "https://github.com/envkey/envkey-app/releases/download/win32-x64-prod-v1.0.1/EnvKey Setup 1.0.1.exe",
"version": "1.0.1"
},
"win32-ia32-prod": {
"update": "https://github.com/envkey/envkey-app/releases/download/win32-ia32-prod-v1.0.0",
"install": "https://github.com/envkey/envkey-app/releases/download/win32-ia32-prod-v1.0.0/EnvKey Setup 1.0.0.exe",
"version": "1.0.0"
"update": "https://github.com/envkey/envkey-app/releases/download/win32-ia32-prod-v1.0.1",
"install": "https://github.com/envkey/envkey-app/releases/download/win32-ia32-prod-v1.0.1/EnvKey Setup 1.0.1.exe",
"version": "1.0.1"
},
"darwin-x64-prod": {
"update": "https://github.com/envkey/envkey-app/releases/download/darwin-x64-prod-v1.0.0/release.json",
"install": "https://github.com/envkey/envkey-app/releases/download/darwin-x64-prod-v1.0.0/EnvKey-1.0.0.dmg",
"version": "1.0.0"
"update": "https://github.com/envkey/envkey-app/releases/download/darwin-x64-prod-v1.0.1/release.json",
"install": "https://github.com/envkey/envkey-app/releases/download/darwin-x64-prod-v1.0.1/EnvKey-1.0.1.dmg",
"version": "1.0.1"
}
}
Expand Up @@ -24,6 +24,13 @@ export default class KeyGenerated extends React.Component {
}
}

_onIntegrationQuickstart(e){
if(shell){
e.preventDefault()
shell.openExternal(e.target.href)
}
}

render(){
return h.div(".key-generated", [
h.span(".close", {onClick: this.props.onClose}, "⨉"),
Expand Down Expand Up @@ -54,7 +61,11 @@ export default class KeyGenerated extends React.Component {
}[this.props.joinType])
),

h.a({href: "https://www.envkey.com/#integration", target: "__blank"}, "Integration quickstart ‣")
h.a({
href: "https://docs.envkey.com/integration-quickstart.html",
target: "__blank",
onClick: ::this._onIntegrationQuickstart
}, "Integration quickstart ‣")
])
])
}
Expand Down
6 changes: 5 additions & 1 deletion envkey-react/src/index.js
Expand Up @@ -13,7 +13,11 @@ crypto.init()

document.body.className += " react-loaded"

const devMode = process.env.NODE_ENV == "development" || process.env.BUILD_ENV == "staging"

// if(!devMode)
startConnectionWatcher()
startReactivatedWatcher()
// startWindowFocusWatcher()
// listenUpdater()
// listenUpdater()

25 changes: 20 additions & 5 deletions envkey-react/src/lib/status/index.js
Expand Up @@ -40,14 +40,29 @@ const
})
},

reactivateIfConnected = type => {
isOnline().then(online => {
if (online){
store.dispatch({type})
} else {
store.dispatch({type: DISCONNECTED})
}
})
},

checkReactivated = ()=> {
const time = Date.now(),
const disconnected = store.getState().disconnected,
time = Date.now(),
diff = time - lastActiveAt

if (diff > (1000 * 60)){
store.dispatch({type: REACTIVATED_LONG})
} else if (diff > (1000 * 10)){
store.dispatch({type: REACTIVATED_BRIEF})
if (!disconnected){
if (diff > (1000 * 60)){
console.log("REACTIVATED_LONG if connected")
reactivateIfConnected(REACTIVATED_LONG)
} else if (diff > (1000 * 10)){
console.log("REACTIVATED_BRIEF if connected")
reactivateIfConnected(REACTIVATED_BRIEF)
}
}

lastActiveAt = time
Expand Down

0 comments on commit 12c7ba7

Please sign in to comment.