From f2fc7246e12266b9dc4eff682b054372782e986c Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 27 Oct 2019 20:45:55 +0900 Subject: [Glitch] Fix an issue where polls with 'expires_at' not set expired Port 5b46467474dd88e1563561bf50643324b4f021e8 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/components/poll.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js index a7f9a97da..2d2a7cbe0 100644 --- a/app/javascript/flavours/glitch/components/poll.js +++ b/app/javascript/flavours/glitch/components/poll.js @@ -39,7 +39,8 @@ class Poll extends ImmutablePureComponent { static getDerivedStateFromProps (props, state) { const { poll, intl } = props; - const expired = poll.get('expired') || (new Date(poll.get('expires_at'))).getTime() < intl.now(); + const expires_at = poll.get('expires_at'); + const expired = poll.get('expired') || expires_at !== null && (new Date(expires_at)).getTime() < intl.now(); return (expired === state.expired) ? null : { expired }; } -- cgit From d76ab556080dc08112187ebfa13e2a8d7760a3e0 Mon Sep 17 00:00:00 2001 From: Gabriel Rubens Date: Mon, 4 Nov 2019 09:03:44 -0300 Subject: [Glitch] Use inert polyfill Port 3cc9ff872f676d7ce56f7cf7875f85f804ea20a9 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/components/modal_root.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/modal_root.js b/app/javascript/flavours/glitch/components/modal_root.js index fd0af9f6e..e73ef8d12 100644 --- a/app/javascript/flavours/glitch/components/modal_root.js +++ b/app/javascript/flavours/glitch/components/modal_root.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import 'wicg-inert'; import createHistory from 'history/createBrowserHistory'; export default class ModalRoot extends React.PureComponent { -- cgit From 84a27a08df5b4000a63b04e290a0f9ca502b226d Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 6 Nov 2019 15:06:53 +0100 Subject: [Glitch] Fix notification message for own poll Port a4301b52026827ad1cd90bfc77fabda92785a4c3 and be93318c0538ccfc41997301800dc347ad0f4271 to glitch-soc --- .../flavours/glitch/components/status_prepend.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch/components') diff --git a/app/javascript/flavours/glitch/components/status_prepend.js b/app/javascript/flavours/glitch/components/status_prepend.js index 344c4d423..637c4f23a 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.js +++ b/app/javascript/flavours/glitch/components/status_prepend.js @@ -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 ( - - ); + if (me === account.get('id')) { + return ( + + ); + } else { + return ( + + ); + } } return null; } -- cgit