@sunggang/ui-lib 0.4.55 → 0.4.57
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/LiffProvider.cjs.js +0 -8
- package/LiffProvider.esm.js +1 -9
- package/package.json +1 -1
package/LiffProvider.cjs.js
CHANGED
|
@@ -463,7 +463,6 @@ var LiffProvider = function(param) {
|
|
|
463
463
|
var _useState5 = _sliced_to_array(React.useState(null), 2), liffProfile = _useState5[0], setLiffProfile = _useState5[1];
|
|
464
464
|
var _useState6 = _sliced_to_array(React.useState(null), 2), isFriendship = _useState6[0], setFriendship = _useState6[1];
|
|
465
465
|
var _useState7 = _sliced_to_array(React.useState(null), 2), loginType = _useState7[0], setLoginType = _useState7[1];
|
|
466
|
-
var isProcessingLiffCallback = React.useRef(false);
|
|
467
466
|
// userInfo 的 localStorage key
|
|
468
467
|
var userInfoStorageKey = "".concat(localStorageKey, "-userInfo");
|
|
469
468
|
// liff profile 的 localStorage key
|
|
@@ -795,11 +794,6 @@ var LiffProvider = function(param) {
|
|
|
795
794
|
originalFetch = window.fetch;
|
|
796
795
|
window.fetch = customFetch;
|
|
797
796
|
if (openInApp && !(liff === null || liff === void 0 ? void 0 : liff.isInClient()) && (liff === null || liff === void 0 ? void 0 : liff.getOS()) !== "web") window.location.href = "line://app/".concat(liffId);
|
|
798
|
-
if (isProcessingLiffCallback.current) {
|
|
799
|
-
return [
|
|
800
|
-
2
|
|
801
|
-
];
|
|
802
|
-
}
|
|
803
797
|
return [
|
|
804
798
|
4,
|
|
805
799
|
liff.init({
|
|
@@ -810,7 +804,6 @@ var LiffProvider = function(param) {
|
|
|
810
804
|
case 2:
|
|
811
805
|
_state.sent();
|
|
812
806
|
console.log("LIFF init succeeded.");
|
|
813
|
-
isProcessingLiffCallback.current = true;
|
|
814
807
|
setLiffObject(liff);
|
|
815
808
|
// 如果 localStorage 或 state 已有 profile,就跳過重複呼叫
|
|
816
809
|
storedProfileExists = false;
|
|
@@ -818,7 +811,6 @@ var LiffProvider = function(param) {
|
|
|
818
811
|
storedProfileExists = !!window.localStorage.getItem(liffUserInfoStorageKey);
|
|
819
812
|
} catch (e) {
|
|
820
813
|
storedProfileExists = false;
|
|
821
|
-
isProcessingLiffCallback.current = false;
|
|
822
814
|
}
|
|
823
815
|
if (!(!storedProfileExists && !liffProfile)) return [
|
|
824
816
|
3,
|
package/LiffProvider.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useState,
|
|
2
|
+
import { createContext, useState, useCallback, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
|
|
4
4
|
function asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, key, arg) {
|
|
5
5
|
try {
|
|
@@ -459,7 +459,6 @@ var LiffProvider = function(param) {
|
|
|
459
459
|
var _useState5 = _sliced_to_array(useState(null), 2), liffProfile = _useState5[0], setLiffProfile = _useState5[1];
|
|
460
460
|
var _useState6 = _sliced_to_array(useState(null), 2), isFriendship = _useState6[0], setFriendship = _useState6[1];
|
|
461
461
|
var _useState7 = _sliced_to_array(useState(null), 2), loginType = _useState7[0], setLoginType = _useState7[1];
|
|
462
|
-
var isProcessingLiffCallback = useRef(false);
|
|
463
462
|
// userInfo 的 localStorage key
|
|
464
463
|
var userInfoStorageKey = "".concat(localStorageKey, "-userInfo");
|
|
465
464
|
// liff profile 的 localStorage key
|
|
@@ -791,11 +790,6 @@ var LiffProvider = function(param) {
|
|
|
791
790
|
originalFetch = window.fetch;
|
|
792
791
|
window.fetch = customFetch;
|
|
793
792
|
if (openInApp && !(liff === null || liff === void 0 ? void 0 : liff.isInClient()) && (liff === null || liff === void 0 ? void 0 : liff.getOS()) !== "web") window.location.href = "line://app/".concat(liffId);
|
|
794
|
-
if (isProcessingLiffCallback.current) {
|
|
795
|
-
return [
|
|
796
|
-
2
|
|
797
|
-
];
|
|
798
|
-
}
|
|
799
793
|
return [
|
|
800
794
|
4,
|
|
801
795
|
liff.init({
|
|
@@ -806,7 +800,6 @@ var LiffProvider = function(param) {
|
|
|
806
800
|
case 2:
|
|
807
801
|
_state.sent();
|
|
808
802
|
console.log("LIFF init succeeded.");
|
|
809
|
-
isProcessingLiffCallback.current = true;
|
|
810
803
|
setLiffObject(liff);
|
|
811
804
|
// 如果 localStorage 或 state 已有 profile,就跳過重複呼叫
|
|
812
805
|
storedProfileExists = false;
|
|
@@ -814,7 +807,6 @@ var LiffProvider = function(param) {
|
|
|
814
807
|
storedProfileExists = !!window.localStorage.getItem(liffUserInfoStorageKey);
|
|
815
808
|
} catch (e) {
|
|
816
809
|
storedProfileExists = false;
|
|
817
|
-
isProcessingLiffCallback.current = false;
|
|
818
810
|
}
|
|
819
811
|
if (!(!storedProfileExists && !liffProfile)) return [
|
|
820
812
|
3,
|