lbry-desktop/src/ui/native.js

25 lines
563 B
JavaScript
Raw Normal View History

2018-04-18 06:03:01 +02:00
const Native = {};
2019-03-05 05:46:57 +01:00
// @if TARGET='app'
import { ipcRenderer } from 'electron';
2018-04-18 06:03:01 +02:00
Native.getAppVersionInfo = () =>
new Promise(resolve => {
2019-02-22 06:01:59 +01:00
// @if TARGET='app'
2018-04-18 06:03:01 +02:00
ipcRenderer.once('version-info-received', (event, versionInfo) => {
resolve(versionInfo);
});
ipcRenderer.send('version-info-requested');
2019-02-22 06:01:59 +01:00
// @endif
2018-04-18 06:03:01 +02:00
});
2019-03-05 05:46:57 +01:00
// @endif
2018-04-18 06:03:01 +02:00
2019-02-22 06:01:59 +01:00
// @if TARGET='app'
2018-04-18 06:03:01 +02:00
Native.imagePath = file => `${staticResourcesPath}/img/${file}`;
2019-02-22 06:01:59 +01:00
// @endif
// @if TARGET='web'
Native.imagePath = file => `staticResourcesPath/img/${file}`;
// @endif
2018-04-18 06:03:01 +02:00
export default Native;