lbry-desktop/ui/native.js

25 lines
563 B
JavaScript
Raw Normal View History

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