From baf282ac3aa07d88c91e229006762781ff228aa5 Mon Sep 17 00:00:00 2001 From: ChunkyProgrammer <78101139+ChunkyProgrammer@users.noreply.github.com> Date: Fri, 3 Mar 2023 14:41:47 -0500 Subject: [PATCH] fix displaying selected tab, get best quality image --- .../components/ft-community-post/ft-community-post.js | 7 ++++++- src/renderer/views/Channel/Channel.css | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/ft-community-post/ft-community-post.js b/src/renderer/components/ft-community-post/ft-community-post.js index fcde36f1a2b4b..1620ce4535d5c 100644 --- a/src/renderer/components/ft-community-post/ft-community-post.js +++ b/src/renderer/components/ft-community-post/ft-community-post.js @@ -116,7 +116,12 @@ export default Vue.extend({ }, getBestQualityImage(imageArray) { - return imageArray.at(-1)?.url ?? '' + const imageArrayCopy = Array.from(imageArray) + imageArrayCopy.sort((a, b) => { + return Number.parseInt(b.width) - Number.parseInt(a.width) + }) + + return imageArrayCopy.at(0)?.url ?? '' } } }) diff --git a/src/renderer/views/Channel/Channel.css b/src/renderer/views/Channel/Channel.css index b14501cd67f8f..4b805f85fd744 100644 --- a/src/renderer/views/Channel/Channel.css +++ b/src/renderer/views/Channel/Channel.css @@ -121,8 +121,7 @@ border-bottom: 3px solid var(--tertiary-text-color); } -.selectedTab:focus, -.selectedTab:hover { +.selectedTab { color: var(--primary-text-color); border-bottom: 3px solid var(--primary-color); font-weight: bold;