diff options
Diffstat (limited to 'gui/src/renderer')
| -rw-r--r-- | gui/src/renderer/app.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx index f9c2390b25..ce7c00c55d 100644 --- a/gui/src/renderer/app.tsx +++ b/gui/src/renderer/app.tsx @@ -3,7 +3,7 @@ import { push as pushHistory, replace as replaceHistory, } from 'connected-react-router'; -import { ipcRenderer, webFrame } from 'electron'; +import { ipcRenderer, shell, webFrame } from 'electron'; import log from 'electron-log'; import { createMemoryHistory } from 'history'; import * as React from 'react'; @@ -288,6 +288,16 @@ export default class AppRenderer { return IpcRendererEventChannel.accountHistory.removeItem(accountToken); } + public async openLinkWithAuth(link: string) { + let token; + try { + token = await IpcRendererEventChannel.account.getWwwAuthToken(); + } catch (e) { + token = ''; + } + shell.openExternal(`${link}?token=${token}`); + } + public async setAllowLan(allowLan: boolean) { const actions = this.reduxActions; await IpcRendererEventChannel.settings.setAllowLan(allowLan); |
