diff --git a/src/components/still-image/still-image.js b/src/components/still-image/still-image.js
index 5ad06dc2..8f3a7206 100644
--- a/src/components/still-image/still-image.js
+++ b/src/components/still-image/still-image.js
@@ -2,7 +2,8 @@ const StillImage = {
props: [
'src',
'referrerpolicy',
- 'mimetype'
+ 'mimetype',
+ 'imageLoadError'
],
data () {
return {
diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue
index 1dcb7ce6..29c59e42 100644
--- a/src/components/still-image/still-image.vue
+++ b/src/components/still-image/still-image.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js
new file mode 100644
index 00000000..bfa2c2b5
--- /dev/null
+++ b/src/components/user_avatar/user_avatar.js
@@ -0,0 +1,28 @@
+import StillImage from '../still-image/still-image.vue'
+import nsfwImage from '../../assets/nsfw.png'
+
+const UserAvatar = {
+ props: [
+ 'src'
+ ],
+ data () {
+ return {
+ showPlaceholder: false
+ }
+ },
+ components: {
+ StillImage
+ },
+ computed: {
+ imgSrc () {
+ return this.showPlaceholder ? nsfwImage : this.src
+ }
+ },
+ methods: {
+ imageLoadError () {
+ this.showPlaceholder = true
+ }
+ }
+}
+
+export default UserAvatar
diff --git a/src/components/user_avatar/user_avatar.vue b/src/components/user_avatar/user_avatar.vue
new file mode 100644
index 00000000..75a857ac
--- /dev/null
+++ b/src/components/user_avatar/user_avatar.vue
@@ -0,0 +1,5 @@
+
+
+
+
+
From 9c4092dbd5887b4476955076fdcbe621718a8d03 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Sat, 2 Feb 2019 14:17:00 -0500
Subject: [PATCH 2/7] Use a correct avatar placeholder image
---
src/assets/avatar-placeholder.png | Bin 0 -> 1083 bytes
src/components/user_avatar/user_avatar.js | 4 ++--
2 files changed, 2 insertions(+), 2 deletions(-)
create mode 100644 src/assets/avatar-placeholder.png
diff --git a/src/assets/avatar-placeholder.png b/src/assets/avatar-placeholder.png
new file mode 100644
index 0000000000000000000000000000000000000000..9c8398da6f597e51e74d86125a48c25ee97b4971
GIT binary patch
literal 1083
zcmV-B1jPG^P)Ew~68
zSOIYhDtvz->s~(kViepQ#TalP3JC*3dzhgq@}?kkb9)YhVr#}*9{dL0PaT0>X5>2{
zBoT-m>eBdoLL+RgEYxuzuRuF>A#~Oa*(c;pOln^gQbR=zwZYbgBRmf~D@sc}Xkccm
zI79_l-mKRLVD4JlSTszG2$N#c2Sq5E-N(6P0u&r!LG4}^0}~E&MubgTWN4T)+a1wo
zi?&+&veH&w3uq85EK5NN)533q1v6Ojo!a{JvOJ0(np8IQtj;>?Ggh1b{^M_({WVkq>bc&0N4RI%2SUUXEyOhIu(=7{EV-A@b%VkLUP*;|t
z@J!sWA2my5RD(2EJNSFXjOg?1Cotvk@_{$v4OK^ed=H{yrC9Xh*7o$u!f+tIN-2xTsdI
zqqQcm;t4L@IUsvq@SMxzGMmG?s+H@lO{fiR>~=q^s9|k>jHHVrDB9pkJl#E;S
zT5P$o;*cI4oLSpf7duJ3(1erGD6oSyG2|sfRO4Q6s;qJHT7n9zPZ*^UeD|GBg&s=h
zdAvbcF!C-59e3S|rehIF(Clqn^U;x3TY`h=gHbnaK;t|%KbRg+7ckS{^!_!k$cC79
zdP+|S5|iLjKtqX1f5a%rxCqLf4>G&X+oMR<>mv&x&RtwQyDwz8ANdo(C;0CtY+E~E
za2BAlVjTPOk(iCE<8Tde@GzHlpXXvA9%(`GfbMTYJq!E~69uEjZU;t>mQYPtGT~b2
zDG)H^eY`jG%)`P&r0M7N^W`!OC-b%;{s2z#Db~E#gb4ru002ovPDHLkV1n08
B1Tp{s
literal 0
HcmV?d00001
diff --git a/src/components/user_avatar/user_avatar.js b/src/components/user_avatar/user_avatar.js
index bfa2c2b5..407ce1a6 100644
--- a/src/components/user_avatar/user_avatar.js
+++ b/src/components/user_avatar/user_avatar.js
@@ -1,5 +1,5 @@
import StillImage from '../still-image/still-image.vue'
-import nsfwImage from '../../assets/nsfw.png'
+import avatarPlaceholderImage from '../../assets/avatar-placeholder.png'
const UserAvatar = {
props: [
@@ -15,7 +15,7 @@ const UserAvatar = {
},
computed: {
imgSrc () {
- return this.showPlaceholder ? nsfwImage : this.src
+ return this.showPlaceholder ? avatarPlaceholderImage : this.src
}
},
methods: {
From d607e4195a114843029e902e09df323096e0dcd6 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Sat, 2 Feb 2019 14:23:16 -0500
Subject: [PATCH 3/7] Migrate StillImage to UserAvatar for avatars
---
src/components/status/status.js | 2 --
src/components/status/status.vue | 2 +-
src/components/user_card/user_card.js | 4 ++--
src/components/user_card/user_card.vue | 2 +-
src/components/user_card_content/user_card_content.js | 4 ++--
src/components/user_card_content/user_card_content.vue | 2 +-
6 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/components/status/status.js b/src/components/status/status.js
index 2004b5cc..25fa205d 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -4,7 +4,6 @@ import RetweetButton from '../retweet_button/retweet_button.vue'
import DeleteButton from '../delete_button/delete_button.vue'
import PostStatusForm from '../post_status_form/post_status_form.vue'
import UserCardContent from '../user_card_content/user_card_content.vue'
-import StillImage from '../still-image/still-image.vue'
import UserAvatar from '../user_avatar/user_avatar.vue'
import Gallery from '../gallery/gallery.vue'
import LinkPreview from '../link-preview/link-preview.vue'
@@ -245,7 +244,6 @@ const Status = {
DeleteButton,
PostStatusForm,
UserCardContent,
- StillImage,
UserAvatar,
Gallery,
LinkPreview
diff --git a/src/components/status/status.vue b/src/components/status/status.vue
index 5611d8d2..cf9d1c47 100644
--- a/src/components/status/status.vue
+++ b/src/components/status/status.vue
@@ -13,7 +13,7 @@