lbry-desktop/src/ui/native.js
2019-03-04 23:48:04 -05:00

24 lines
563 B
JavaScript

const Native = {};
// @if TARGET='app'
import { ipcRenderer } from 'electron';
Native.getAppVersionInfo = () =>
new Promise(resolve => {
// @if TARGET='app'
ipcRenderer.once('version-info-received', (event, versionInfo) => {
resolve(versionInfo);
});
ipcRenderer.send('version-info-requested');
// @endif
});
// @endif
// @if TARGET='app'
Native.imagePath = file => `${staticResourcesPath}/img/${file}`;
// @endif
// @if TARGET='web'
Native.imagePath = file => `staticResourcesPath/img/${file}`;
// @endif
export default Native;