diff --git a/packages/concordia-app/src/components/PollView/PollDataInvalid/index.jsx b/packages/concordia-app/src/components/PollView/PollDataInvalid/index.jsx new file mode 100644 index 0000000..c699e45 --- /dev/null +++ b/packages/concordia-app/src/components/PollView/PollDataInvalid/index.jsx @@ -0,0 +1,16 @@ +import React from 'react'; +import { Container, Header, Icon } from 'semantic-ui-react'; + +const PollDataInvalid = () => ( + +
+ + + This topic has a poll but the data are untrusted! + The poll data downloaded from the poster have been tampered with. + +
+
+); + +export default PollDataInvalid; diff --git a/packages/concordia-app/src/components/PollView/index.jsx b/packages/concordia-app/src/components/PollView/index.jsx index 2014cf7..bb2ab0d 100644 --- a/packages/concordia-app/src/components/PollView/index.jsx +++ b/packages/concordia-app/src/components/PollView/index.jsx @@ -15,6 +15,7 @@ import PollVote from './PollVote'; import { FETCH_USER_DATABASE } from '../../redux/actions/peerDbReplicationActions'; import { generatePollHash, generateHash } from '../../utils/hashUtils'; import { POLL_OPTIONS, POLL_QUESTION } from '../../constants/orbit/PollsDatabaseKeys'; +import PollDataInvalid from './PollDataInvalid'; const { contracts: { [VOTING_CONTRACT]: { methods: { getPoll: { cacheCall: getPollChainData } } } } } = drizzle; const { orbit } = breeze; @@ -144,17 +145,23 @@ const PollView = (props) => { return ( -
- - - - {loading - ? - : pollQuestion} - - -
- + {!loading && pollHashValid + ? ( + <> +
+ + + + {loading + ? + : pollQuestion} + + +
+ + + ) + : }
); };