From d36b129369ccb67dcba27b2cd3544fdf270abef7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 3 Sep 2019 07:25:02 +0900 Subject: Improve reaction tooltip --- src/client/app/common/views/components/reactions-viewer.details.vue | 6 +++++- .../app/common/views/components/reactions-viewer.reaction.vue | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/client') diff --git a/src/client/app/common/views/components/reactions-viewer.details.vue b/src/client/app/common/views/components/reactions-viewer.details.vue index efe7eb39ba..35c648278d 100644 --- a/src/client/app/common/views/components/reactions-viewer.details.vue +++ b/src/client/app/common/views/components/reactions-viewer.details.vue @@ -12,7 +12,7 @@ {{ users.slice(0, 10).join(', ') }} - {{ users.length - 10 }} + {{ count - 10 }} @@ -34,6 +34,10 @@ export default Vue.extend({ type: Array, required: true, }, + count: { + type: Number, + required: true, + }, source: { required: true, } diff --git a/src/client/app/common/views/components/reactions-viewer.reaction.vue b/src/client/app/common/views/components/reactions-viewer.reaction.vue index c06430e5eb..dade012c29 100644 --- a/src/client/app/common/views/components/reactions-viewer.reaction.vue +++ b/src/client/app/common/views/components/reactions-viewer.reaction.vue @@ -102,9 +102,10 @@ export default Vue.extend({ if (this.$root.isMobile) return; this.$root.api('notes/reactions', { noteId: this.note.id, - limit: 30 + type: this.reaction, + limit: 11 }).then((reactions: any[]) => { - const users = reactions.filter(x => x.type === this.reaction) + const users = reactions .sort((a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime()) .map(x => x.user); @@ -113,6 +114,7 @@ export default Vue.extend({ this.details = this.$root.new(XDetails, { reaction: this.reaction, users, + count: this.count, source: this.$refs.reaction }); }); -- cgit v1.2.3-freya