@local-civics/hub-ui 0.1.113 → 0.1.114

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/dist/index.d.ts CHANGED
@@ -499,6 +499,8 @@ type LearningFormProps = {
499
499
  rating?: number;
500
500
  items?: FormItemProps[];
501
501
  preview?: boolean;
502
+ timeSpent?: number;
503
+ elapsedTime?: number;
502
504
  stopWatch?: React__default.ReactNode;
503
505
  onHome?: () => void;
504
506
  onGoBack?: () => void;
package/dist/index.js CHANGED
@@ -4262,6 +4262,12 @@ const LearningForm = (props) => {
4262
4262
  setIsDraft(true);
4263
4263
  }
4264
4264
  }, [currentAnswersKey]);
4265
+ React.useEffect(() => {
4266
+ if (props.timeSpent !== props.elapsedTime && !isDraft) {
4267
+ setIsDraft(true);
4268
+ }
4269
+ return;
4270
+ }, [props.timeSpent, props.elapsedTime]);
4265
4271
  const onReflectionChange = (responses) => {
4266
4272
  if (!responses || responses.length === 0) {
4267
4273
  setReflection("");