lbry-desktop/ui/native.js
2019-11-11 13:27:29 -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;