@sunggang/ui-lib 0.4.55 → 0.4.56

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.
@@ -768,7 +768,7 @@ var LiffProvider = function(param) {
768
768
  // 初始化 LIFF
769
769
  var initializeLiff = function() {
770
770
  var _ref = _async_to_generator(function(isValid) {
771
- var customFetch, liff, originalFetch, storedProfileExists, profile, profileErr, lineToken, redirectUri, tempFriendship, friendship, friendFlag, error, err;
771
+ var customFetch, liff, urlParams, hasLiffParams, originalFetch, storedProfileExists, profile, profileErr, lineToken, redirectUri, tempFriendship, friendship, friendFlag, error, err;
772
772
  return _ts_generator(this, function(_state) {
773
773
  switch(_state.label){
774
774
  case 0:
@@ -792,10 +792,13 @@ var LiffProvider = function(param) {
792
792
  ];
793
793
  case 1:
794
794
  liff = _state.sent().liff;
795
+ urlParams = new URLSearchParams(window.location.search);
796
+ hasLiffParams = urlParams.has("liffClientId") || urlParams.has("liffRedirectUri");
795
797
  originalFetch = window.fetch;
796
798
  window.fetch = customFetch;
797
799
  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) {
800
+ if (hasLiffParams || isProcessingLiffCallback.current) {
801
+ isProcessingLiffCallback.current = true;
799
802
  return [
800
803
  2
801
804
  ];
@@ -764,7 +764,7 @@ var LiffProvider = function(param) {
764
764
  // 初始化 LIFF
765
765
  var initializeLiff = function() {
766
766
  var _ref = _async_to_generator(function(isValid) {
767
- var customFetch, liff, originalFetch, storedProfileExists, profile, profileErr, lineToken, redirectUri, tempFriendship, friendship, friendFlag, error, err;
767
+ var customFetch, liff, urlParams, hasLiffParams, originalFetch, storedProfileExists, profile, profileErr, lineToken, redirectUri, tempFriendship, friendship, friendFlag, error, err;
768
768
  return _ts_generator(this, function(_state) {
769
769
  switch(_state.label){
770
770
  case 0:
@@ -788,10 +788,13 @@ var LiffProvider = function(param) {
788
788
  ];
789
789
  case 1:
790
790
  liff = _state.sent().liff;
791
+ urlParams = new URLSearchParams(window.location.search);
792
+ hasLiffParams = urlParams.has("liffClientId") || urlParams.has("liffRedirectUri");
791
793
  originalFetch = window.fetch;
792
794
  window.fetch = customFetch;
793
795
  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) {
796
+ if (hasLiffParams || isProcessingLiffCallback.current) {
797
+ isProcessingLiffCallback.current = true;
795
798
  return [
796
799
  2
797
800
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.4.55",
3
+ "version": "0.4.56",
4
4
  "sideEffects": [
5
5
  "*.css",
6
6
  "./src/style.css",