@blocklet/launcher-workflow 2.1.5 → 2.1.6

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 +4 -14
  2. package/package.json +5 -5
package/lib/purchase.js CHANGED
@@ -115,7 +115,6 @@ function PurchasePage(_ref) {
115
115
  }] = (0, _useMeasure.default)();
116
116
  const [showRedeem, setShowRedeem] = (0, _react.useState)(false);
117
117
  const [state, setState] = (0, _useSetState.default)({
118
- launch: null,
119
118
  loading: true,
120
119
  error: '',
121
120
  plans: [],
@@ -185,15 +184,11 @@ function PurchasePage(_ref) {
185
184
  const metaUrl = params.get('blocklet_meta_url');
186
185
  if (params.get('sessionId')) {
187
186
  _util.launchSession.load(api, routerPrefix, params.get('sessionId'), metaUrl, (err, launch) => {
188
- setState({
189
- launch
190
- });
191
187
  selectPlan(launch);
192
188
  });
193
189
  } else if (metaUrl) {
194
190
  _util.launchSession.create(api, routerPrefix, metaUrl, (err, launch) => {
195
191
  setState({
196
- launch,
197
192
  sessionId: launch._id
198
193
  });
199
194
  selectPlan(launch);
@@ -253,24 +248,19 @@ function PurchasePage(_ref) {
253
248
  setState({
254
249
  planId
255
250
  });
251
+ };
252
+ (0, _react.useEffect)(() => {
256
253
  if (isPurchaseOnly) {
257
254
  return;
258
255
  }
259
-
260
- // FIXME: @wangshijun should not always be serverless
261
- _util.launchSession.select(api, routerPrefix, state.sessionId, 'serverless', planId, (err, launch) => {
262
- setState({
263
- launch
264
- });
265
- });
266
- };
267
- (0, _react.useEffect)(() => {
268
256
  if (!state.planId) {
269
257
  return;
270
258
  }
271
259
  if (state.planId !== params.get('planId')) {
272
260
  params.set('planId', state.planId);
273
261
  setParams(params);
262
+ // FIXME: @wangshijun should not always be serverless
263
+ _util.launchSession.select(api, routerPrefix, state.sessionId, 'serverless', state.planId);
274
264
  }
275
265
  }, [state.planId]);
276
266
  const productFeatures = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-workflow",
3
- "version": "2.1.5",
3
+ "version": "2.1.6",
4
4
  "description": "Purchase components for Launcher UI",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -40,9 +40,9 @@
40
40
  "@arcblock/license": "^2.5.47",
41
41
  "@arcblock/react-hooks": "^2.5.47",
42
42
  "@arcblock/ux": "^2.5.47",
43
- "@blocklet/launcher-layout": "2.1.5",
44
- "@blocklet/launcher-util": "2.1.5",
45
- "@blocklet/launcher-ux": "2.1.5",
43
+ "@blocklet/launcher-layout": "2.1.6",
44
+ "@blocklet/launcher-util": "2.1.6",
45
+ "@blocklet/launcher-ux": "2.1.6",
46
46
  "@blocklet/payment": "^1.11.0",
47
47
  "@emotion/react": "^11.11.0",
48
48
  "@emotion/styled": "^11.11.0",
@@ -75,5 +75,5 @@
75
75
  "babel-plugin-inline-react-svg": "^2.0.2",
76
76
  "jest": "^27.5.1"
77
77
  },
78
- "gitHead": "0ea2e85db41a58ec0398f184242c29f74f11634a"
78
+ "gitHead": "0ce72656e21595f9bee690ce3c3a5446d781ed50"
79
79
  }