From 6074f16f9b9cfe0643fa128e5b99ac1214d79dfd Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 25 Jun 2020 15:09:56 +0200 Subject: [PATCH] Notifications: Reduxify. --- src/components/notification/notification.js | 12 ++--- src/components/notification/notification.vue | 48 +++++++++---------- .../entity_normalizer.service.js | 7 +++ 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 5aa40e98..6a0872b8 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -31,7 +31,7 @@ const Notification = { return generateProfileLink(user.id, user.screen_name, this.$store.state.instance.restrictedNicknames) }, getUser (notification) { - return this.$store.state.users.usersObject[notification.from_profile.id] + return this.$store.state.users.usersObject[notification.redux.account.id] }, toggleMute () { this.unmuted = !this.unmuted @@ -57,21 +57,21 @@ const Notification = { }, computed: { userClass () { - return highlightClass(this.notification.from_profile) + return highlightClass(this.notification.redux.account) }, userStyle () { const highlight = this.$store.getters.mergedConfig.highlight - const user = this.notification.from_profile + const user = this.notification.redux.account return highlightStyle(highlight[user.screen_name]) }, user () { - return this.$store.getters.findUser(this.notification.from_profile.id) + return this.$store.getters.findUser(this.notification.redux.account.id) }, userProfileLink () { return this.generateUserProfileLink(this.user) }, targetUser () { - return this.$store.getters.findUser(this.notification.target.id) + return this.$store.getters.findUser(this.notification.redux.target.id) }, targetUserProfileLink () { return this.generateUserProfileLink(this.targetUser) @@ -80,7 +80,7 @@ const Notification = { return this.$store.getters.relationship(this.user.id).muting }, isStatusNotification () { - return isStatusNotification(this.notification.type) + return (this.notification.redux.type) } } } diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index 044ac871..efd9da2a 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,8 +1,8 @@