@blocklet/launcher-workflow 1.9.22 → 1.9.23

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/lib/purchase.js +8 -11
  2. package/package.json +6 -6
package/lib/purchase.js CHANGED
@@ -58,12 +58,6 @@ function PurchasePage(_ref) {
58
58
  const [searchParams] = (0, _reactRouterDom.useSearchParams)();
59
59
  const userDid = query.get('userDid') || (0, _lodash.default)(session, 'user.did');
60
60
  const isEmbed = !!query.get('blocklet_meta_url');
61
- (0, _react.useEffect)(() => {
62
- if (!session.loading && (paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.type) === 'fiat' && !userDid) {
63
- session.login();
64
- }
65
- // eslint-disable-next-line
66
- }, [paymentMethod, userDid]);
67
61
  const handlePaid = async (_ref2, decrypt) => {
68
62
  let {
69
63
  nftId,
@@ -105,17 +99,20 @@ function PurchasePage(_ref) {
105
99
  const handleCancelPay = () => {
106
100
  setPaying(false);
107
101
  };
108
- const handlePay = async payment => {
109
- if (payment.type === 'fiat' && !userDid) {
110
- session.login();
111
- return;
112
- }
102
+ const pay = () => {
113
103
  const params = getPurchaseParams();
114
104
  if (!params.productId) {
115
105
  return;
116
106
  }
117
107
  setPaying(true);
118
108
  };
109
+ const handlePay = payment => {
110
+ if (payment.type === 'fiat' && !userDid) {
111
+ session.login(() => pay());
112
+ return;
113
+ }
114
+ pay();
115
+ };
119
116
  const handleRedeem = () => {
120
117
  handlePaid({
121
118
  nftId: _constant.REDEEM_NFT_ID
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-workflow",
3
- "version": "1.9.22",
3
+ "version": "1.9.23",
4
4
  "description": "Purchase components for Launcher UI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,9 +40,9 @@
40
40
  "@arcblock/icons": "^2.4.57",
41
41
  "@arcblock/license": "^2.4.57",
42
42
  "@arcblock/ux": "^2.4.57",
43
- "@blocklet/launcher-layout": "1.9.22",
44
- "@blocklet/launcher-util": "1.9.22",
45
- "@blocklet/launcher-ux": "1.9.22",
43
+ "@blocklet/launcher-layout": "1.9.23",
44
+ "@blocklet/launcher-util": "1.9.23",
45
+ "@blocklet/launcher-ux": "1.9.23",
46
46
  "@did-pay/react": "^1.9.31",
47
47
  "@emotion/react": "^11.10.5",
48
48
  "@emotion/styled": "^11.10.5",
@@ -58,7 +58,7 @@
58
58
  "lodash.throttle": "^4.1.1",
59
59
  "prop-types": "^15.8.1",
60
60
  "react-lottie-player": "^1.5.0",
61
- "react-router-dom": "^6.4.4",
61
+ "react-router-dom": "^6.4.5",
62
62
  "react-use": "^17.4.0",
63
63
  "url-join": "^4.0.1"
64
64
  },
@@ -69,5 +69,5 @@
69
69
  "@babel/preset-react": "^7.18.6",
70
70
  "babel-plugin-inline-react-svg": "^2.0.1"
71
71
  },
72
- "gitHead": "bd9c98f9e42b2f5eaf9b1c0036ee6e9ad093693d"
72
+ "gitHead": "d96ed9cba0abe8c30d0f505aba5595d3adea5595"
73
73
  }