diff options
Diffstat (limited to 'app/lib')
| -rw-r--r-- | app/lib/backend.js | 2 | ||||
| -rw-r--r-- | app/lib/jsonrpc-ws-ipc.js | 2 | ||||
| -rw-r--r-- | app/lib/platform.android.js | 14 | ||||
| -rw-r--r-- | app/lib/platform.js | 14 |
4 files changed, 22 insertions, 10 deletions
diff --git a/app/lib/backend.js b/app/lib/backend.js index 62babdf4b6..cd14adb045 100644 --- a/app/lib/backend.js +++ b/app/lib/backend.js @@ -1,6 +1,6 @@ // @flow -import log from 'electron-log'; +import { log } from '../lib/platform'; import EventEmitter from 'events'; import { IpcFacade, RealIpc } from './ipc-facade'; import accountActions from '../redux/account/actions'; diff --git a/app/lib/jsonrpc-ws-ipc.js b/app/lib/jsonrpc-ws-ipc.js index 909b4b0775..002a146606 100644 --- a/app/lib/jsonrpc-ws-ipc.js +++ b/app/lib/jsonrpc-ws-ipc.js @@ -2,7 +2,7 @@ import jsonrpc from 'jsonrpc-lite'; import uuid from 'uuid'; -import log from 'electron-log'; +import { log } from '../lib/platform'; export type UnansweredRequest = { resolve: (mixed) => void, diff --git a/app/lib/platform.android.js b/app/lib/platform.android.js index d7bd39b867..fe7fd533f2 100644 --- a/app/lib/platform.android.js +++ b/app/lib/platform.android.js @@ -1,13 +1,19 @@ // @flow -import { BackHandler } from 'react-native'; -import { Linking } from 'react-native'; +import { BackHandler, Linking } from 'react-native'; +import { MobileAppBridge } from 'NativeModules'; + +const log = console.log; const exit = () => { BackHandler.exitApp(); }; -const open = (link: string) => { +const openLink = (link: string) => { Linking.openURL(link); }; -export {exit, open}; +const openItem = (path: string) => { + MobileAppBridge.openItem(path); +}; + +export { log, exit, openLink, openItem }; diff --git a/app/lib/platform.js b/app/lib/platform.js index 66e5a099ba..2b078b8bb6 100644 --- a/app/lib/platform.js +++ b/app/lib/platform.js @@ -1,13 +1,19 @@ // @flow -import { remote } from 'electron'; -import { shell } from 'electron'; +import { remote, shell } from 'electron'; +import electronLog from 'electron-log'; + +const log = electronLog; const exit = () => { remote.app.quit(); }; -const open = (link: string) => { +const openLink = (link: string) => { shell.openExternal(link); }; -export {exit, open}; +const openItem = (path: string) => { + shell.openItem(path); +}; + +export { log, exit, openLink, openItem }; |
