MCPcopy Create free account
hub / github.com/ampproject/amphtml / complete

Method complete

third_party/subscriptions-project/swg.js:6032–6072  ·  view source on GitHub ↗

* @return {!Promise}

()

Source from the content-addressed store, hash-verified

6030 * @return {!Promise}
6031 */
6032 complete() {
6033 this.eventManager_.logSwgEvent(
6034 AnalyticsEvent.ACTION_ACCOUNT_CREATED,
6035 true,
6036 getEventParams$1(this.sku_ || '')
6037 );
6038 const now = Date.now().toString();
6039 this.deps_
6040 .storage()
6041 .set(Constants$1.READ_TIME, now, /*useLocalStorage=*/ false);
6042 this.deps_.entitlementsManager().unblockNextNotification();
6043 return Promise.all([
6044 this.activityIframeViewPromise_,
6045 this.readyPromise_,
6046 this.clientConfigManager_.getClientConfig(),
6047 ]).then((values) => {
6048 const activityIframeView = values[0];
6049 const clientConfig = values[2];
6050 // Skip account creation screen if requested (needed for AMP)
6051 if (!clientConfig.skipAccountCreationScreen) {
6052 const accountCompletionRequest = new AccountCreationRequest();
6053 accountCompletionRequest.setComplete(true);
6054 activityIframeView.execute(accountCompletionRequest);
6055 }
6056 return activityIframeView
6057 .acceptResult()
6058 .catch(() => {
6059 // Ignore errors.
6060 })
6061 .then(() => {
6062 if (!clientConfig.skipAccountCreationScreen) {
6063 this.eventManager_.logSwgEvent(
6064 AnalyticsEvent.ACTION_ACCOUNT_ACKNOWLEDGED,
6065 true,
6066 getEventParams$1(this.sku_ || '')
6067 );
6068 }
6069 this.deps_.entitlementsManager().setToastShown(true);
6070 });
6071 });
6072 }
6073}
6074
6075/** @private {boolean} */

Callers 3

showUi_Method · 0.45

Calls 15

setCompleteMethod · 0.95
getEventParams$1Function · 0.85
logSwgEventMethod · 0.80
nowMethod · 0.80
storageMethod · 0.80
entitlementsManagerMethod · 0.80
getClientConfigMethod · 0.80
catchMethod · 0.80
setToastShownMethod · 0.80
toStringMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected