]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix notification message for own poll
authorThibaut Girka <thib@sitedethib.com>
Wed, 6 Nov 2019 14:06:53 +0000 (15:06 +0100)
committerThibaut Girka <thib@sitedethib.com>
Wed, 6 Nov 2019 14:06:53 +0000 (15:06 +0100)
Port a4301b52026827ad1cd90bfc77fabda92785a4c3 and be93318c0538ccfc41997301800dc347ad0f4271 to glitch-soc

app/javascript/flavours/glitch/components/status_prepend.js

index 344c4d4236505710c2baf083951de1ddb2fd757c..637c4f23aa44fa0ea2a2e631b507aa89ad35e84a 100644 (file)
@@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
 import ImmutablePropTypes from 'react-immutable-proptypes';
 import { FormattedMessage } from 'react-intl';
 import Icon from 'flavours/glitch/components/icon';
+import { me } from 'flavours/glitch/util/initial_state';
 
 export default class StatusPrepend extends React.PureComponent {
 
@@ -64,12 +65,21 @@ export default class StatusPrepend extends React.PureComponent {
         />
       );
     case 'poll':
-      return (
-        <FormattedMessage
-          id='notification.poll'
-          defaultMessage='A poll you have voted in has ended'
-        />
-      );
+      if (me === account.get('id')) {
+        return (
+          <FormattedMessage
+            id='notification.own_poll'
+            defaultMessage='Your poll has ended'
+          />
+        );
+      } else {
+        return (
+          <FormattedMessage
+            id='notification.poll'
+            defaultMessage='A poll you have voted in has ended'
+          />
+        );
+      }
     }
     return null;
   }