fix: __static path not resolving on development environment (#1165)

This fixes https://github.com/electron-userland/electron-webpack/issues/52
This commit is contained in:
Igor Gassmann 2018-03-22 10:53:24 -04:00 committed by GitHub
parent b6351a367a
commit 4b41c6335d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 3 additions and 13 deletions

View file

@ -20,7 +20,6 @@
},
"globals": {
"__static": true,
"staticResourcesPath": true,
"__": true,
"__n": true,
"app": true

View file

@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
* Error when clicking LBRY URLs when app is closed on macOS ([#1119](https://github.com/lbryio/lbry-app/issues/1119))
* LBRY URLs not working on Linux ([#1120](https://github.com/lbryio/lbry-app/issues/1120))
* Fix Windows notifications not showing ([1145](https://github.com/lbryio/lbry-app/pull/1145))
* Fix __static path not resolving on development environment
### Deprecated
*

View file

@ -22,16 +22,6 @@ const app = {
},
};
// Workaround for https://github.com/electron-userland/electron-webpack/issues/52
if (!isDev) {
window.staticResourcesPath = Path.join(remote.app.getAppPath(), '../static').replace(
/\\/g,
'\\\\'
);
} else {
window.staticResourcesPath = '';
}
// eslint-disable-next-line no-underscore-dangle
global.__ = i18n.__;
// eslint-disable-next-line no-underscore-dangle

View file

@ -172,7 +172,7 @@ Lbry.publishDeprecated = (params, fileListedCallback, publishedCallback, errorCa
);
};
Lbry.imagePath = file => `${staticResourcesPath}/img/${file}`;
Lbry.imagePath = file => `file://${__static}/img/${file}`;
Lbry.getMediaType = (contentType, fileName) => {
if (contentType) {

View file

@ -30,6 +30,6 @@ export const selectThemePath = createSelector(
selectIsNight,
(theme, automaticDarkModeEnabled, isNight) => {
const dynamicTheme = automaticDarkModeEnabled && isNight ? 'dark' : theme;
return `${staticResourcesPath}/themes/${dynamicTheme || 'light'}.css`;
return `file://${__static}/themes/${dynamicTheme || 'light'}.css`;
}
);