Skip to content

Commit

Permalink
Merge pull request #1626 from qidonna/swg
Browse files Browse the repository at this point in the history
Add setOnLoginRequest to BasicRuntime init()
  • Loading branch information
qidonna authored Apr 26, 2021
2 parents dfebf79 + 4aac30c commit 70fa7ca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
10 changes: 1 addition & 9 deletions src/api/basic-subscriptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ export class BasicSubscriptions {

/**
* Open CheckEntitlementsView to let users log in Google and check their entitlements.
* @param {function(!LoginRequest)} callback
* @return {?}
*/
setOnLoginRequest(callback) {}
setOnLoginRequest() {}

/**
* Creates and displays a SwG subscription or contribution prompt, where the
Expand Down Expand Up @@ -106,13 +105,6 @@ export const AutoPromptType = {
*/
export let ClientOptions;

/**
* @typedef {{
* linkRequested: boolean,
* }}
*/
export let LoginRequest;

/** @enum {string} */
export const ClientTheme = {
LIGHT: 'light',
Expand Down
7 changes: 4 additions & 3 deletions src/runtime/basic-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export class BasicRuntime {
autoPromptType: params.autoPromptType,
alwaysShow: false,
});
this.setOnLoginRequest();
}
/* eslint-enable no-unused-vars */

Expand All @@ -216,9 +217,9 @@ export class BasicRuntime {
}

/** @override */
setOnLoginRequest(callback) {
setOnLoginRequest() {
return this.configured_(false).then((runtime) =>
runtime.setOnLoginRequest(callback)
runtime.setOnLoginRequest()
);
}

Expand Down Expand Up @@ -394,7 +395,7 @@ export class ConfiguredBasicRuntime {
}

/** @override */
setOnLoginRequest(unusedCallback) {
setOnLoginRequest() {
const runtime = this.configuredClassicRuntime_;
const args = feArgs({
'publicationId': runtime.pageConfig().getPublicationId(),
Expand Down

0 comments on commit 70fa7ca

Please sign in to comment.