From 9de652c631e5630ee819452e317e75c819241a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Wed, 27 Mar 2019 14:16:00 +0100 Subject: [PATCH] Fix render error bug :raised_hands: @mattwr18 --- webapp/pages/settings/my-social-media.vue | 25 ++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/webapp/pages/settings/my-social-media.vue b/webapp/pages/settings/my-social-media.vue index 6bccd9949..1552c5512 100644 --- a/webapp/pages/settings/my-social-media.vue +++ b/webapp/pages/settings/my-social-media.vue @@ -18,19 +18,19 @@ -
@@ -51,7 +51,18 @@ export default { computed: { ...mapGetters({ currentUser: 'auth/user' - }) + }), + socialMediaLinks() { + const { socialMedia = [] } = this.currentUser + return socialMedia.map(url => { + const matches = url.match( + /^(?:https?:\/\/)?(?:[^@\n])?(?:www\.)?([^:\/\n?]+)/g + ) + const [domain] = matches || [] + const favicon = domain ? `${domain}/favicon.ico` : null + return { url, favicon } + }) + } }, methods: { handleAddSocialMedia() {