From 6bafac54bf375cd60f1c06f6afdc648e0e19743d Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 5 Dec 2017 15:01:47 +0100 Subject: [PATCH] Fix missing default avatar --- client/config/webpack.common.js | 12 ++++++++++++ client/src/app/shared/users/user.model.ts | 2 +- client/src/assets/images/favicon.png | Bin 2335 -> 539 bytes client/src/index.html | 2 +- server/controllers/client.ts | 2 ++ 5 files changed, 16 insertions(+), 2 deletions(-) diff --git a/client/config/webpack.common.js b/client/config/webpack.common.js index acf22dab1..c37516271 100644 --- a/client/config/webpack.common.js +++ b/client/config/webpack.common.js @@ -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 diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts index 220362ef0..9364ae721 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -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' } } diff --git a/client/src/assets/images/favicon.png b/client/src/assets/images/favicon.png index bb57ee6b0200ec38a2e0205edcd80ca2e602c3b9..cef0f0d2e2d36017421b9e327ae46a11c1b6373f 100644 GIT binary patch literal 539 zcmV+$0_6RPP)12P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wmr9S3{_m1KYB#Ahv~fB-TzVb z`~FGuAGs&jrp>iljsHsViO=s__(0QZ3n%00tw(+m;6DPe=Vb_Kp0@x1002ovPDHLk FV1g|HPU-*v diff --git a/client/src/index.html b/client/src/index.html index 8e94b903d..4af6b12f6 100644 --- a/client/src/index.html +++ b/client/src/index.html @@ -11,7 +11,7 @@ - + diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 64e5829ca..f474c4282 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -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) => {