MCPcopy Index your code
hub / github.com/ampproject/amphtml / handler

Method handler

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

* Handler function. * @param {!../components/activities.ActivityPortDef} port

(port)

Source from the content-addressed store, hash-verified

14146 * @param {!../components/activities.ActivityPortDef} port
14147 */
14148 function handler(port) {
14149 deps.entitlementsManager().blockNextNotification();
14150 deps.callbacks().triggerLinkProgress();
14151 deps.dialogManager().popupClosed();
14152 const promise = acceptPortResultData(
14153 port,
14154 feOrigin(),
14155 /* requireOriginVerified */ false,
14156 /* requireSecureChannel */ false
14157 );
14158 return promise.then(
14159 (response) => {
14160 deps
14161 .eventManager()
14162 .logSwgEvent(AnalyticsEvent.ACTION_LINK_CONTINUE, true);
14163 deps
14164 .eventManager()
14165 .logSwgEvent(AnalyticsEvent.EVENT_LINK_ACCOUNT_SUCCESS);
14166 const flow = new LinkCompleteFlow(deps, response);
14167 flow.start();
14168 },
14169 (reason) => {
14170 if (isCancelError(reason)) {
14171 deps
14172 .eventManager()
14173 .logSwgEvent(AnalyticsEvent.ACTION_LINK_CANCEL, true);
14174 deps
14175 .callbacks()
14176 .triggerFlowCanceled(SubscriptionFlows.LINK_ACCOUNT);
14177 } else {
14178 // The user chose to continue but there was an error.
14179 deps
14180 .eventManager()
14181 .logSwgEvent(AnalyticsEvent.ACTION_LINK_CONTINUE, true);
14182 }
14183 }
14184 );
14185 }
14186 deps.activities().onResult(LINK_REQUEST_ID, handler);
14187 }
14188

Callers 1

invoke_Method · 0.45

Calls 14

startMethod · 0.95
acceptPortResultDataFunction · 0.85
feOriginFunction · 0.85
isCancelErrorFunction · 0.85
blockNextNotificationMethod · 0.80
entitlementsManagerMethod · 0.80
triggerLinkProgressMethod · 0.80
callbacksMethod · 0.80
popupClosedMethod · 0.80
dialogManagerMethod · 0.80
logSwgEventMethod · 0.80
eventManagerMethod · 0.80

Tested by

no test coverage detected