@mjhls/mjh-framework 1.0.522 → 1.0.523

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.522
2
+ # mjh-framework v. 1.0.523
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -7347,7 +7347,6 @@ var Poll = function Poll(_ref) {
7347
7347
  videoAccountIDs = _ref.videoAccountIDs,
7348
7348
  onVote = _ref.onVote,
7349
7349
  _ref$showVotes = _ref.showVotes,
7350
- showVotes = _ref$showVotes === undefined ? false : _ref$showVotes,
7351
7350
  getSerializers = _ref.getSerializers;
7352
7351
 
7353
7352
  var _useState = React.useState(null),
@@ -7355,21 +7354,28 @@ var Poll = function Poll(_ref) {
7355
7354
  selectedChoice = _useState2[0],
7356
7355
  setSelectedChoice = _useState2[1];
7357
7356
 
7358
- var _useState3 = React.useState(showVotes),
7357
+ var _useState3 = React.useState(false),
7359
7358
  _useState4 = slicedToArray._slicedToArray(_useState3, 2),
7360
7359
  showAnswer = _useState4[0],
7361
7360
  setShowAnswer = _useState4[1];
7362
7361
 
7363
7362
  var choices = node.choices,
7364
7363
  question = node.question,
7365
- response = node.response;
7364
+ response = node.response,
7365
+ _node$showResults = node.showResults,
7366
+ showResults = _node$showResults === undefined ? false : _node$showResults;
7366
7367
 
7367
7368
 
7368
7369
  var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
7369
7370
  e.preventDefault();
7370
7371
  onVote(node._key, selectedChoice);
7371
- setShowAnswer(true);
7372
+ //setShowAnswer(true)
7372
7373
  };
7374
+ React.useEffect(function () {
7375
+ if (showResults) {
7376
+ setShowAnswer(showResults);
7377
+ }
7378
+ }, [showResults]);
7373
7379
 
7374
7380
  var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
7375
7381
  if (choice.choiceCount) {
@@ -7390,7 +7396,7 @@ var Poll = function Poll(_ref) {
7390
7396
  !showAnswer && choices && choices.length > 0 && React__default.createElement(
7391
7397
  'form',
7392
7398
  { onSubmit: function onSubmit(e) {
7393
- return onSubmitPoll(e, setShowAnswer);
7399
+ return onSubmitPoll(e);
7394
7400
  } },
7395
7401
  choices && choices.map(function (choice) {
7396
7402
  return React__default.createElement(
@@ -7341,7 +7341,6 @@ var Poll = function Poll(_ref) {
7341
7341
  videoAccountIDs = _ref.videoAccountIDs,
7342
7342
  onVote = _ref.onVote,
7343
7343
  _ref$showVotes = _ref.showVotes,
7344
- showVotes = _ref$showVotes === undefined ? false : _ref$showVotes,
7345
7344
  getSerializers = _ref.getSerializers;
7346
7345
 
7347
7346
  var _useState = useState(null),
@@ -7349,21 +7348,28 @@ var Poll = function Poll(_ref) {
7349
7348
  selectedChoice = _useState2[0],
7350
7349
  setSelectedChoice = _useState2[1];
7351
7350
 
7352
- var _useState3 = useState(showVotes),
7351
+ var _useState3 = useState(false),
7353
7352
  _useState4 = _slicedToArray(_useState3, 2),
7354
7353
  showAnswer = _useState4[0],
7355
7354
  setShowAnswer = _useState4[1];
7356
7355
 
7357
7356
  var choices = node.choices,
7358
7357
  question = node.question,
7359
- response = node.response;
7358
+ response = node.response,
7359
+ _node$showResults = node.showResults,
7360
+ showResults = _node$showResults === undefined ? false : _node$showResults;
7360
7361
 
7361
7362
 
7362
7363
  var onSubmitPoll = function onSubmitPoll(e, setShowAnswer) {
7363
7364
  e.preventDefault();
7364
7365
  onVote(node._key, selectedChoice);
7365
- setShowAnswer(true);
7366
+ //setShowAnswer(true)
7366
7367
  };
7368
+ useEffect(function () {
7369
+ if (showResults) {
7370
+ setShowAnswer(showResults);
7371
+ }
7372
+ }, [showResults]);
7367
7373
 
7368
7374
  var choicesTotalCount = choices && choices.reduce(function (acc, choice) {
7369
7375
  if (choice.choiceCount) {
@@ -7384,7 +7390,7 @@ var Poll = function Poll(_ref) {
7384
7390
  !showAnswer && choices && choices.length > 0 && React__default.createElement(
7385
7391
  'form',
7386
7392
  { onSubmit: function onSubmit(e) {
7387
- return onSubmitPoll(e, setShowAnswer);
7393
+ return onSubmitPoll(e);
7388
7394
  } },
7389
7395
  choices && choices.map(function (choice) {
7390
7396
  return React__default.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.522",
3
+ "version": "1.0.523",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",