Fix file paths for static resources

This commit is contained in:
Igor Gassmann 2017-12-04 17:06:56 -03:00
parent 9cbb413264
commit 496acd0a3c
6 changed files with 12 additions and 12 deletions

View file

@ -178,7 +178,7 @@ function createWindow () {
if (isDebug) { if (isDebug) {
win.webContents.openDevTools(); win.webContents.openDevTools();
} }
win.loadURL(`file://${app.getAppPath()}/dist/index.html`) win.loadURL(`file://${__static}/index.html`)
if (openUri) { // We stored and received a URI that an external app requested before we had a window object if (openUri) { // We stored and received a URI that an external app requested before we had a window object
win.webContents.on('did-finish-load', () => { win.webContents.on('did-finish-load', () => {
win.webContents.send('open-uri-requested', openUri); win.webContents.send('open-uri-requested', openUri);
@ -240,9 +240,9 @@ function createTray () {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
// Using @2x for mac retina screens so the icon isn't blurry // Using @2x for mac retina screens so the icon isn't blurry
// file name needs to include "Template" at the end for dark menu bar // file name needs to include "Template" at the end for dark menu bar
iconPath = path.join(app.getAppPath(), "/dist/img/fav/macTemplate@2x.png"); iconPath = path.join(__static, "/img/fav/macTemplate@2x.png");
} else { } else {
iconPath = path.join(app.getAppPath(), "/dist/img/fav/32x32.png"); iconPath = path.join(__static, "/img/fav/32x32.png");
} }
tray = new Tray(iconPath); tray = new Tray(iconPath);
@ -315,7 +315,7 @@ function handleDaemonSubprocessExited() {
// TODO: maybe it would be better to restart the daemon? // TODO: maybe it would be better to restart the daemon?
if (win) { if (win) {
console.log('Did not request daemon stop, so quitting in 5 seconds.'); console.log('Did not request daemon stop, so quitting in 5 seconds.');
win.loadURL(`file://${app.getAppPath()}/dist/warning.html`); win.loadURL(`file://${__static}/warning.html`);
setTimeout(quitNow, 5000); setTimeout(quitNow, 5000);
} else { } else {
console.log('Did not request daemon stop, so quitting.'); console.log('Did not request daemon stop, so quitting.');
@ -507,7 +507,7 @@ function upgrade(event, installerPath) {
}); });
if (win) { if (win) {
win.loadURL(`file://${app.getAppPath()}/dist/upgrade.html`); win.loadURL(`file://${__static}/upgrade.html`);
} }
shutdownDaemonAndQuit(true); shutdownDaemonAndQuit(true);

View file

@ -204,7 +204,7 @@ lbry.publishDeprecated = function(
}; };
lbry.imagePath = function(file) { lbry.imagePath = function(file) {
return "img/" + file; return __static + "img/" + file;
}; };
lbry.getMediaType = function(contentType, fileName) { lbry.getMediaType = function(contentType, fileName) {

View file

@ -23,7 +23,7 @@ class SettingsPage extends React.PureComponent {
}); });
const success = () => { const success = () => {
this.setState({ clearingCache: false }); this.setState({ clearingCache: false });
window.location.href = `${remote.app.getAppPath()}/dist/index.html`; window.location.href = `${__static}/index.html`;
}; };
const clear = () => this.props.clearCache().then(success.bind(this)); const clear = () => this.props.clearCache().then(success.bind(this));

View file

@ -52,7 +52,7 @@ export function doSetClientSetting(key, value) {
export function doGetThemes() { export function doGetThemes() {
return function(dispatch, getState) { return function(dispatch, getState) {
const dir = `${remote.app.getAppPath()}/dist/themes`; const dir = `${__static}/themes`;
readdir(dir, (error, files) => { readdir(dir, (error, files) => {
if (!error) { if (!error) {

View file

@ -61,7 +61,7 @@ body
&:before { &:before {
$width: 30px; $width: 30px;
position: absolute; position: absolute;
background: url('../img/busy.gif') no-repeat center center; background: url(__static + '../img/busy.gif') no-repeat center center;
width: $width; width: $width;
height: $spacing-vertical; height: $spacing-vertical;
content: ""; content: "";
@ -127,7 +127,7 @@ p
.busy-indicator .busy-indicator
{ {
background: url('../img/busy.gif') no-repeat center center; background: url(__static + '/img/busy.gif') no-repeat center center;
display: inline-block; display: inline-block;
margin: -1em 0; margin: -1em 0;
min-width: 16px; min-width: 16px;

View file

@ -1,7 +1,7 @@
@font-face { @font-face {
font-family: 'FontAwesome'; font-family: 'FontAwesome';
src: url('../font/fontawesome-webfont.eot?v=4.7.0'); src: url(__static + '/font/fontawesome-webfont.eot?v=4.7.0');
src: url('../font/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../font/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../font/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../font/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../font/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); src: url(__static + '/font/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url(__static + '/font/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url(__static + '/font/fontawesome-webfont.woff?v=4.7.0') format('woff'), url(__static + '/font/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url(__static + '/font/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
} }