touchstudy-core 0.1.172 → 0.1.174
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/containers/PreparedTextbook/configs/constants.d.ts +1 -1
- package/dist/index.js +8 -11
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +8 -11
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/HeaderLink.d.ts +8 -0
- package/dist/layouts/TimerDropdown.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -35371,7 +35371,7 @@ var CompareTypeOptions = [{
|
|
35371
35371
|
value: QuestionAnswerType.SynonymProcessing
|
35372
35372
|
}];
|
35373
35373
|
var SAVE_TIME_INTERVAL_IN_MILLISECONDS = 60 * 1000;
|
35374
|
-
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS =
|
35374
|
+
var SAVE_TIME_MAX_DIFF_IN_MILLISECONDS = 1000;
|
35375
35375
|
|
35376
35376
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
35377
35377
|
var children = props.children,
|
@@ -38549,6 +38549,7 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
38549
38549
|
|
38550
38550
|
var _excluded$n = ["isCreatedByAdmin", "isSuperAdminUser", "isSuperAdmin", "isAdmin", "textbookId", "selected", "coverImage", "disabled", "ownersDisabled", "selectedTextbook", "handleSaveData", "onChangeTab", "onUploadImage"];
|
38551
38551
|
var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
38552
|
+
var _valuesTextbook$curre;
|
38552
38553
|
var isCreatedByAdmin = _ref.isCreatedByAdmin,
|
38553
38554
|
isSuperAdminUser = _ref.isSuperAdminUser,
|
38554
38555
|
isSuperAdmin = _ref.isSuperAdmin,
|
@@ -38572,7 +38573,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38572
38573
|
var savedRunRef = useRef(Date.now());
|
38573
38574
|
var runTimeRef = useRef(Date.now());
|
38574
38575
|
var valuesTextbook = useRef(null);
|
38575
|
-
var
|
38576
|
+
var isFirstLoadRef = useRef(true);
|
38576
38577
|
var _React$useState = React__default.useState(PrintStatus.Idle),
|
38577
38578
|
saveStatus = _React$useState[0],
|
38578
38579
|
setSaveStatus = _React$useState[1];
|
@@ -38580,11 +38581,8 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38580
38581
|
var isProcessingRef = useRef(false);
|
38581
38582
|
var pendingValuesRef = useRef(null);
|
38582
38583
|
var _useState = useState(),
|
38583
|
-
|
38584
|
-
|
38585
|
-
var _useState2 = useState(),
|
38586
|
-
lastEdited = _useState2[0],
|
38587
|
-
setLastEdited = _useState2[1];
|
38584
|
+
lastEdited = _useState[0],
|
38585
|
+
setLastEdited = _useState[1];
|
38588
38586
|
useEffect(function () {
|
38589
38587
|
var handleBeforeUnload = function handleBeforeUnload(event) {
|
38590
38588
|
var message = t$1("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
|
@@ -38606,9 +38604,9 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38606
38604
|
setValues(newValues);
|
38607
38605
|
};
|
38608
38606
|
useEffect(function () {
|
38609
|
-
if (!valuesTextbook.current &&
|
38607
|
+
if (!valuesTextbook.current && isFirstLoadRef.current && !_$8.isEqual(values, DEFAULT_TEXTBOOK_REQUEST)) {
|
38610
38608
|
valuesTextbook.current = _$8.cloneDeep(values);
|
38611
|
-
|
38609
|
+
isFirstLoadRef.current = false;
|
38612
38610
|
}
|
38613
38611
|
}, [values]);
|
38614
38612
|
var _handleSave = function handleSave(valuesProps) {
|
@@ -38624,7 +38622,6 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38624
38622
|
savedRunRef.current = now;
|
38625
38623
|
runTimeRef.current = now;
|
38626
38624
|
setSaveStatus(PrintStatus.Saved);
|
38627
|
-
setSaved(valuesToSave);
|
38628
38625
|
});
|
38629
38626
|
}, function (error) {
|
38630
38627
|
setSaveStatus(PrintStatus.Idle);
|
@@ -38698,7 +38695,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
38698
38695
|
var contentsErrors = errors.chapters;
|
38699
38696
|
var textbookOwnersErrors = errors.textbookOwners;
|
38700
38697
|
var hasError = !_$8.isEmpty(errors);
|
38701
|
-
var isSaved = !lastEdited || _$8.isEqual(values,
|
38698
|
+
var isSaved = !lastEdited || _$8.isEqual(values, (_valuesTextbook$curre = valuesTextbook.current) != null ? _valuesTextbook$curre : {});
|
38702
38699
|
return React__default.createElement(Form, null, React__default.createElement(Stack, {
|
38703
38700
|
direction: "column",
|
38704
38701
|
gap: 3
|