pb-sxp-ui 1.15.7 → 1.15.8

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/pb-ui.js CHANGED
@@ -477,11 +477,20 @@
477
477
  return window.localStorage.getItem(feRealSessionIdKey);
478
478
  };
479
479
 
480
+ /*
481
+ * @Author: binruan@chatlabs.com
482
+ * @Date: 2024-03-20 10:27:31
483
+ * @LastEditors: binruan@chatlabs.com
484
+ * @LastEditTime: 2025-02-25 16:43:21
485
+ * @FilePath: \pb-sxp-ui\src\core\utils\localStore.ts
486
+ *
487
+ */
480
488
  const FAKE_USER_KEY = 'SXP_FAKE_USER_ID';
481
- const FAKE_USER_STATE = 'FAKE_USER_STATE'; //新用户仅显示一次滑动提示
489
+ const FAKE_USER_STATE = 'FAKE_USER_STATE'; // 新用户仅显示一次滑动提示
482
490
  const AGREE_POLICY = 'AGREE_POLICY';
483
- const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; //新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
484
- const CCONTSENT_STATE = 'CCONTSENT_STATE'; //新用户仅显示一次contsent弹窗
491
+ const SLIDE_SKIP_STATE = 'SLIDE_SKIP_STATE'; // 新用户滑动下一个视频跳转外链状态(触发过一次就不再触发)
492
+ const CCONTSENT_STATE = 'CCONTSENT_STATE'; // 新用户仅显示一次contsent弹窗
493
+ const USER_CONSENT_RESULT_KEY = 'USER_CONSENT_RESULT'; // 用户已授权consent弹窗
485
494
  const storeAndLoadFeUserId = () => {
486
495
  let fakeUserId = window.localStorage.getItem(FAKE_USER_KEY);
487
496
  if (lodash.isEmpty(fakeUserId)) {
@@ -511,6 +520,13 @@
511
520
  }
512
521
  return lodash.isEmpty(contsentState);
513
522
  };
523
+ const getUserConsentResult = () => {
524
+ const contsentState = window.localStorage.getItem(USER_CONSENT_RESULT_KEY);
525
+ return contsentState === 'true';
526
+ };
527
+ const setUserConsentResult = () => {
528
+ window.localStorage.setItem(USER_CONSENT_RESULT_KEY, 'true');
529
+ };
514
530
 
515
531
  /*
516
532
  * @Author: binruan@chatlabs.com
@@ -16918,12 +16934,14 @@ Made in Italy` })));
16918
16934
  return consentPopupCate || (open && style && !consentResult);
16919
16935
  }, [consentPopupCate, open, style, consentResult]);
16920
16936
  React.useEffect(() => {
16921
- !consentPopupCate && open && style && handleGetAccount();
16937
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
16922
16938
  }, []);
16923
16939
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
16924
16940
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
16925
- if (res)
16941
+ if (res) {
16926
16942
  setConsentResult(true);
16943
+ setUserConsentResult();
16944
+ }
16927
16945
  });
16928
16946
  const handleClickReject = () => {
16929
16947
  history === null || history === void 0 ? void 0 : history.back();
@@ -17062,12 +17080,14 @@ Made in Italy` })));
17062
17080
  return consentPopupCate || (open && style && !consentResult);
17063
17081
  }, [consentPopupCate, open, style, consentResult]);
17064
17082
  React.useEffect(() => {
17065
- !consentPopupCate && open && style && handleGetAccount();
17083
+ !consentPopupCate && open && style && !getUserConsentResult() && handleGetAccount();
17066
17084
  }, []);
17067
17085
  const handleClickAccept = () => __awaiter(void 0, void 0, void 0, function* () {
17068
17086
  const res = yield (accountSonsent === null || accountSonsent === void 0 ? void 0 : accountSonsent(true));
17069
- if (res)
17087
+ if (res) {
17070
17088
  setConsentResult(true);
17089
+ setUserConsentResult();
17090
+ }
17071
17091
  });
17072
17092
  const handleTouchStart = (event) => {
17073
17093
  const touch = event.touches[0];
@@ -18406,7 +18426,7 @@ Made in Italy` })));
18406
18426
  * @Author: binruan@chatlabs.com
18407
18427
  * @Date: 2024-03-20 10:27:31
18408
18428
  * @LastEditors: binruan@chatlabs.com
18409
- * @LastEditTime: 2025-02-25 15:51:17
18429
+ * @LastEditTime: 2025-02-25 16:50:19
18410
18430
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\index.tsx
18411
18431
  *
18412
18432
  */
@@ -18945,8 +18965,8 @@ Made in Italy` })));
18945
18965
  isReload,
18946
18966
  renderToggleButton
18947
18967
  ]);
18948
- return (React.createElement("div", { id: 'sxp-render' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
18949
- React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { className: 'clc-sxp-container', style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
18968
+ return (React.createElement("div", { id: 'sxp-render', className: 'clc-sxp-container' }, (data === null || data === void 0 ? void 0 : data.length) < 1 && loading ? (React.createElement("div", { style: { height, width: containerWidth, display: 'flex', justifyContent: 'center', alignItems: 'center' } },
18969
+ React.createElement("img", { width: 64, height: 64, src: loadingImage, alt: 'loading...', style: { objectFit: 'contain' } }))) : (React.createElement("div", { style: Object.assign({}, ((globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset) && { textUnderlineOffset: `${globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.textUnderlineOffset}px` })) },
18950
18970
  waterFallData && (React.createElement(Navbar$1, { icon: img, styles: { background: 'rgba(0,0,0,.3)', color: '#fff', top: `${minusHeight}px` }, textStyle: Object.assign(Object.assign({}, (_e = (_d = (_c = (_b = (_a = globalConfig === null || globalConfig === void 0 ? void 0 : globalConfig.hashTag) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.item) === null || _c === void 0 ? void 0 : _c.props) === null || _d === void 0 ? void 0 : _d.textStyles) === null || _e === void 0 ? void 0 : _e.hashTagTitle), { color: '#fff' }), onClose: () => {
18951
18971
  const isEq = lodash.isEqual(rtcList, cacheRtcList);
18952
18972
  if (!isEq && cacheRtcList && (cacheRtcList === null || cacheRtcList === void 0 ? void 0 : cacheRtcList.length)) {