@gamelearn/arcade-components 2.39.1 → 2.39.2
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/components/image-click-wrapper-component/components/ImageClickWrapperComponent.js
CHANGED
|
@@ -172,10 +172,15 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
172
172
|
var clearIntervalForCountDown = (0, _react.useCallback)(function () {
|
|
173
173
|
clearInterval(intervalForCountDown.current);
|
|
174
174
|
}, []);
|
|
175
|
-
var pauseTheCounter = (0, _react.useCallback)(function () {
|
|
175
|
+
var pauseTheCounter = (0, _react.useCallback)(function (remainingTimeWhenPauseTheCounter) {
|
|
176
176
|
pauseDate.current = Date.now();
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
if (!finalDate.current) {
|
|
178
|
+
remainingTime.current = pauseDate.current - (pauseDate.current - remainingTimeWhenPauseTheCounter * 1000);
|
|
179
|
+
clearListenerForActualDate();
|
|
180
|
+
} else {
|
|
181
|
+
remainingTime.current = finalDate.current - pauseDate.current;
|
|
182
|
+
clearListenerForActualDate();
|
|
183
|
+
}
|
|
179
184
|
}, [clearListenerForActualDate]);
|
|
180
185
|
var feedbackError = (0, _react.useCallback)(function () {
|
|
181
186
|
setFeedbackData(function () {
|
|
@@ -342,7 +347,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
342
347
|
if (hasClickOrder && area.index === clickedZones.length || !hasClickOrder) {
|
|
343
348
|
var _specificFeedbacks$co2;
|
|
344
349
|
if (timer) {
|
|
345
|
-
pauseTheCounter();
|
|
350
|
+
pauseTheCounter(countDownTime);
|
|
346
351
|
}
|
|
347
352
|
handleClick();
|
|
348
353
|
if (specificFeedbacks !== null && specificFeedbacks !== void 0 && (_specificFeedbacks$co2 = specificFeedbacks.correctFeedbacks) !== null && _specificFeedbacks$co2 !== void 0 && _specificFeedbacks$co2.length) {
|
|
@@ -367,7 +372,6 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
367
372
|
});
|
|
368
373
|
if (timer) {
|
|
369
374
|
clearIntervalForCountDown();
|
|
370
|
-
pauseTheCounter();
|
|
371
375
|
}
|
|
372
376
|
}
|
|
373
377
|
}
|
|
@@ -399,7 +403,7 @@ var ImageClickWrapperComponent = function ImageClickWrapperComponent(props) {
|
|
|
399
403
|
setDialogForTimer(false);
|
|
400
404
|
}
|
|
401
405
|
}
|
|
402
|
-
}, [
|
|
406
|
+
}, [defaultCompleted, firstTryForFrame, puzzlesAutoCompleted, slideNumber, timer]);
|
|
403
407
|
(0, _react.useEffect)(function () {
|
|
404
408
|
if (timer && countDownTime === 0) feedbackError();
|
|
405
409
|
}, [countDownTime, feedbackError, timer]);
|