From a1df2de7e27621f0b5b89f9af44f865b27fc7a31 Mon Sep 17 00:00:00 2001 From: QuentinHsu Date: Fri, 24 Jun 2022 14:41:37 +0800 Subject: [PATCH] perf (UI): Use display name in collections closes #127 --- web/src/views/SubEditor.vue | 7 ++++++- web/src/views/Subscription.vue | 14 ++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/web/src/views/SubEditor.vue b/web/src/views/SubEditor.vue index 237c242..6f5ae5e 100644 --- a/web/src/views/SubEditor.vue +++ b/web/src/views/SubEditor.vue @@ -39,7 +39,12 @@ - {{ sub.name }} + + diff --git a/web/src/views/Subscription.vue b/web/src/views/Subscription.vue index 809545c..0a68cc0 100644 --- a/web/src/views/Subscription.vue +++ b/web/src/views/Subscription.vue @@ -64,8 +64,8 @@ - - {{ subs }} + + {{ subs['display-name'] || subs.name}} @@ -175,8 +175,14 @@ export default { }, collections() { const cols = this.$store.state.collections; - return Object.keys(cols).map(k => cols[k]); - } + const collections = Object.keys(cols).map(k => cols[k]); + const subscriptions = this.$store.state.subscriptions; + collections.map(item => { + item.subsInfo = [] + item.subscriptions.map(sub => item.subsInfo.push(subscriptions[sub])) + }) + return collections + }, }, methods: {