From 9f9395d9652af62d996f1f579291555b99f52588 Mon Sep 17 00:00:00 2001
From: Lim Chee Aun
Date: Sun, 11 Dec 2022 12:15:39 +0800
Subject: [PATCH] Better copy to differentiate poll created vs voted
---
src/pages/notifications.jsx | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/pages/notifications.jsx b/src/pages/notifications.jsx
index ff14eeaa..9b141c3f 100644
--- a/src/pages/notifications.jsx
+++ b/src/pages/notifications.jsx
@@ -9,6 +9,7 @@ import Loader from '../components/loader';
import NameText from '../components/name-text';
import Status from '../components/status';
import states from '../utils/states';
+import store from '../utils/store';
import useTitle from '../utils/useTitle';
/*
@@ -34,6 +35,8 @@ const contentText = {
follow_request: 'requested to follow you.',
favourite: 'favourited your status.',
poll: 'A poll you have voted in or created has ended.',
+ 'poll-self': 'A poll you have created has ended.',
+ 'poll-voted': 'A poll you have voted in has ended.',
update: 'A status you interacted with has been edited.',
};
@@ -45,6 +48,15 @@ function Notification({ notification }) {
// status = Attached when type of the notification is favourite, reblog, status, mention, poll, or update
const actualStatusID = status?.reblog?.id || status?.id;
+ const currentAccount = store.session.get('currentAccount');
+ const isSelf = currentAccount?.id === account.id;
+ const isVoted = status?.poll?.voted;
+
+ const text =
+ type === 'poll'
+ ? contentText[isSelf ? 'poll-self' : isVoted ? 'poll-voted' : 'poll']
+ : contentText[type];
+
return (
<>
{' '}
>
)}
- {contentText[type]}
+ {text}