Fix missing default avatar

pull/159/head
Chocobozzz 2017-12-05 15:01:47 +01:00
parent be6a480232
commit 6bafac54bf
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
5 changed files with 16 additions and 2 deletions

View File

@ -13,6 +13,7 @@ const LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
const InlineManifestWebpackPlugin = require('inline-manifest-webpack-plugin')
const ngcWebpack = require('ngc-webpack')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const WebpackNotifierPlugin = require('webpack-notifier')
@ -267,6 +268,17 @@ module.exports = function (options) {
inject: 'body'
}),
new CopyWebpackPlugin([
{
from: helpers.root('src/assets/images/favicon.png'),
to: 'assets/images/favicon.png'
},
{
from: helpers.root('src/assets/images/default-avatar.png'),
to: 'assets/images/default-avatar.png'
}
]),
/*
* Plugin: ScriptExtHtmlWebpackPlugin
* Description: Enhances html-webpack-plugin functionality

View File

@ -54,6 +54,6 @@ export class User implements UserServerModel {
getAvatarPath () {
if (this.account && this.account.avatar) return this.account.avatar.path
return '/assets/images/default-avatar.png'
return '/client/assets/images/default-avatar.png'
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 539 B

View File

@ -11,7 +11,7 @@
<!-- open graph and oembed tags -->
<!-- Do not remove it! -->
<link rel="icon" type="image/png" href="/client/assets/favicon.png" />
<link rel="icon" type="image/png" href="/client/assets/images/favicon.png" />
<!-- base url -->
<base href="<%= htmlWebpackPlugin.options.metadata.baseUrl %>">

View File

@ -18,6 +18,7 @@ import { VideoInstance } from '../models'
const clientsRouter = express.Router()
const distPath = join(root(), 'client', 'dist')
const assetsImagesPath = join(root(), 'client', 'dist', 'assets', 'images')
const embedPath = join(distPath, 'standalone', 'videos', 'embed.html')
const indexPath = join(distPath, 'index.html')
@ -33,6 +34,7 @@ clientsRouter.use('/videos/embed', (req: express.Request, res: express.Response,
// Static HTML/CSS/JS client files
clientsRouter.use('/client', express.static(distPath, { maxAge: STATIC_MAX_AGE }))
clientsRouter.use('/client/assets/images', express.static(assetsImagesPath, { maxAge: STATIC_MAX_AGE }))
// 404 for static files not found
clientsRouter.use('/client/*', (req: express.Request, res: express.Response, next: express.NextFunction) => {