@sunggang/ui-lib 0.2.67 → 0.2.69

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.
Files changed (2) hide show
  1. package/index.esm2.js +11 -12
  2. package/package.json +1 -1
package/index.esm2.js CHANGED
@@ -58923,7 +58923,7 @@ var LiffProvider = function(param) {
58923
58923
  // 登入初始化函數
58924
58924
  var loginInit = function() {
58925
58925
  var _ref = _async_to_generator(function(token) {
58926
- var _resData_data, _resData_data1, response, resData, _resData_data2, loginToken, err;
58926
+ var _resData_data, _resData_data1, _resData_data2, response, resData, _resData_data3, loginToken, err;
58927
58927
  return _ts_generator(this, function(_state) {
58928
58928
  switch(_state.label){
58929
58929
  case 0:
@@ -58955,12 +58955,13 @@ var LiffProvider = function(param) {
58955
58955
  response = _state.sent();
58956
58956
  resData = response;
58957
58957
  console.log("login response", response);
58958
+ setLoginData(resData);
58958
58959
  if (!(resData === null || resData === void 0 ? void 0 : (_resData_data = resData.data) === null || _resData_data === void 0 ? void 0 : _resData_data.access_token.startsWith("Bearer "))) {
58959
- resData.data.access_token = "Bearer ".concat(resData === null || resData === void 0 ? void 0 : (_resData_data2 = resData.data) === null || _resData_data2 === void 0 ? void 0 : _resData_data2.access_token);
58960
+ resData.data.access_token = "Bearer ".concat(resData === null || resData === void 0 ? void 0 : (_resData_data3 = resData.data) === null || _resData_data3 === void 0 ? void 0 : _resData_data3.access_token);
58960
58961
  }
58961
- setLoginData(resData);
58962
+ console.log("has token", !!(resData === null || resData === void 0 ? void 0 : (_resData_data1 = resData.data) === null || _resData_data1 === void 0 ? void 0 : _resData_data1.access_token));
58962
58963
  window.localStorage.setItem(localStorageKey, JSON.stringify(resData));
58963
- loginToken = resData === null || resData === void 0 ? void 0 : (_resData_data1 = resData.data) === null || _resData_data1 === void 0 ? void 0 : _resData_data1.access_token;
58964
+ loginToken = resData === null || resData === void 0 ? void 0 : (_resData_data2 = resData.data) === null || _resData_data2 === void 0 ? void 0 : _resData_data2.access_token;
58964
58965
  if (loginToken) {
58965
58966
  setAccessToken(loginToken);
58966
58967
  if (memberInfoUrl) fetchMemberInfo(loginToken);
@@ -59138,14 +59139,12 @@ var LiffProvider = function(param) {
59138
59139
  }();
59139
59140
  checkAndInitialize();
59140
59141
  }, []);
59141
- useEffect(function() {
59142
- if (typeof window !== "undefined") {
59143
- var storedLoginData = window.localStorage.getItem(localStorageKey);
59144
- setLoginData(storedLoginData ? JSON.parse(storedLoginData) : null);
59145
- }
59146
- }, [
59147
- localStorageKey
59148
- ]);
59142
+ // useEffect(() => {
59143
+ // if (typeof window !== 'undefined') {
59144
+ // const storedLoginData = window.localStorage.getItem(localStorageKey);
59145
+ // setLoginData(storedLoginData ? JSON.parse(storedLoginData) : null);
59146
+ // }
59147
+ // }, [localStorageKey]);
59149
59148
  var contextValue = useMemo$1(function() {
59150
59149
  return {
59151
59150
  liffObject: liffObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.2.67",
3
+ "version": "0.2.69",
4
4
  "dependencies": {
5
5
  "@iconify/react": "^4.1.1",
6
6
  "@material-ui/core": "^4.12.4",