touchstudy-core 0.1.63 → 0.1.65

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.
@@ -498,8 +498,16 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
498
498
  };
499
499
  };
500
500
 
501
- var pushTo = function pushTo(history, data) {
502
- if (history.push) history.push(data);else history(data);
501
+ var pushTo = function pushTo(history, data, isReplace) {
502
+ if (isReplace === void 0) {
503
+ isReplace = false;
504
+ }
505
+ if (history.push && !isReplace || history.replace && isReplace) {
506
+ !isReplace && history.push(data);
507
+ isReplace && history.replace(data);
508
+ } else history(data, {
509
+ replace: isReplace
510
+ });
503
511
  };
504
512
 
505
513
  var getErrorMessage = function getErrorMessage(t, error, defaultErrorMessage) {
@@ -935,7 +943,7 @@ var defaultInfo = {
935
943
  captcha: "",
936
944
  rememberMe: false
937
945
  };
938
- var useLogin$1 = function useLogin(history) {
946
+ var useLogin$1 = function useLogin() {
939
947
  var _useState = useState(false),
940
948
  openLogin = _useState[0],
941
949
  setOpenLogin = _useState[1];
@@ -959,7 +967,7 @@ var useLogin$1 = function useLogin(history) {
959
967
  }, [gapi]);
960
968
  useEffect(function () {
961
969
  var token = getAccessToken();
962
- if (!!token) pushTo(history, "/");
970
+ if (token) window.location.href = "/";
963
971
  }, []);
964
972
  return {
965
973
  defaultInfo: defaultInfo,
@@ -1018,8 +1026,9 @@ var useLanguage = function useLanguage(history) {
1018
1026
  var search = window.location.search;
1019
1027
  var searchParams = new URLSearchParams(search);
1020
1028
  if (!languageItem) {
1029
+ var _navigator$language, _navigator$language$s;
1021
1030
  var storedLanguage = getLanguage();
1022
- var browserLanguage = navigator.language;
1031
+ var browserLanguage = (_navigator$language = navigator.language) === null || _navigator$language === void 0 ? void 0 : (_navigator$language$s = _navigator$language.split("-")) === null || _navigator$language$s === void 0 ? void 0 : _navigator$language$s[0];
1023
1032
  var defaultLanguageCode = storedLanguage || browserLanguage;
1024
1033
  languageItem = LANGUAGES.find(function (i) {
1025
1034
  return i.code === defaultLanguageCode;
@@ -1033,7 +1042,7 @@ var useLanguage = function useLanguage(history) {
1033
1042
  searchParams.set("lang", languageItem.code);
1034
1043
  pushTo(history, _extends({}, window.location, {
1035
1044
  search: searchParams.toString()
1036
- }));
1045
+ }), true);
1037
1046
  };
1038
1047
  var handleChangeLanguageParam = function handleChangeLanguageParam() {
1039
1048
  var search = window.location.search;
@@ -1069,7 +1078,7 @@ var _excluded = ["history"];
1069
1078
  var Login = function Login(_ref) {
1070
1079
  var history = _ref.history,
1071
1080
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
1072
- var _useLogin = useLogin$1(history),
1081
+ var _useLogin = useLogin$1(),
1073
1082
  defaultInfo = _useLogin.defaultInfo;
1074
1083
  useLanguage(history);
1075
1084
  return React__default.createElement("div", {
@@ -1375,7 +1384,6 @@ var Loading = function Loading() {
1375
1384
  var isLoading = useSelector(function (state) {
1376
1385
  return state.common.isLoading;
1377
1386
  });
1378
- localStorage.setItem("LAST_TIME_REQUETST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
1379
1387
  return isLoading ? React__default.createElement("div", {
1380
1388
  style: loadingStyle
1381
1389
  }, React__default.createElement("div", {
@@ -1902,6 +1910,7 @@ var correct_answer_for_each_student = "학생별 정답 여부";
1902
1910
  var information_by_question = "문항별 정보";
1903
1911
  var no_data = "데이터 없음";
1904
1912
  var internet_connection_was_lost = "인터넷 연결이 끊어졌습니다";
1913
+ var internet_connection_is_back = "인터넷 연결이 다시 돌아왔습니다";
1905
1914
  var problem = "문제";
1906
1915
  var number_problem = "{{number}}문제";
1907
1916
  var problems = "문제";
@@ -2530,6 +2539,7 @@ var lang_ko = {
2530
2539
  information_by_question: information_by_question,
2531
2540
  no_data: no_data,
2532
2541
  internet_connection_was_lost: internet_connection_was_lost,
2542
+ internet_connection_is_back: internet_connection_is_back,
2533
2543
  problem: problem,
2534
2544
  number_problem: number_problem,
2535
2545
  problems: problems,
@@ -3148,7 +3158,8 @@ var question_time_for_each_student$1 = "Question time for each student";
3148
3158
  var correct_answer_for_each_student$1 = "Correct answer for each student";
3149
3159
  var information_by_question$1 = "Information by question";
3150
3160
  var no_data$1 = "No data";
3151
- var internet_connection_was_lost$1 = "Internet connection was lost";
3161
+ var internet_connection_was_lost$1 = "The internet connection was lost";
3162
+ var internet_connection_is_back$1 = "The internet connection is back";
3152
3163
  var problem$1 = "Problem";
3153
3164
  var number_problem$1 = "No.{{number}}";
3154
3165
  var problems$1 = "Problems";
@@ -3777,6 +3788,7 @@ var lang_en = {
3777
3788
  information_by_question: information_by_question$1,
3778
3789
  no_data: no_data$1,
3779
3790
  internet_connection_was_lost: internet_connection_was_lost$1,
3791
+ internet_connection_is_back: internet_connection_is_back$1,
3780
3792
  problem: problem$1,
3781
3793
  number_problem: number_problem$1,
3782
3794
  problems: problems$1,
@@ -9498,7 +9510,7 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
9498
9510
  searchParams["delete"]("domain");
9499
9511
  pushTo(history, _extends({}, window.location, {
9500
9512
  search: searchParams.toString()
9501
- }));
9513
+ }), true);
9502
9514
  return;
9503
9515
  }
9504
9516
  } else {
@@ -9518,7 +9530,7 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
9518
9530
  searchParams.set("domain", academyDomain);
9519
9531
  pushTo(history, _extends({}, window.location, {
9520
9532
  search: searchParams.toString()
9521
- }));
9533
+ }), true);
9522
9534
  return;
9523
9535
  }
9524
9536
  }
@@ -14402,7 +14414,7 @@ var useLogin$2 = function useLogin(_ref) {
14402
14414
  };
14403
14415
  useEffect(function () {
14404
14416
  var token = getAccessToken();
14405
- if (!!token) pushTo(history, "/");
14417
+ if (token) window.location.href = "/";
14406
14418
  }, []);
14407
14419
  return {
14408
14420
  handleSubmit: handleSubmit,