* Handler function. * @param {!../components/activities.ActivityPortDef} port
(port)
| 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 |
no test coverage detected