Skip to content

Commit

Permalink
fixed changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysmithTTD committed Dec 6, 2024
1 parent 6bc7d44 commit 41209bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 4 additions & 5 deletions examples/cstg/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$('#targeted_advertising_ready').text(sdk.getAdvertisingToken() ? 'yes' : 'no');
$('#advertising_token').text(String(sdk.getAdvertisingToken()));
$('#login_required').text(
sdk.noIdentityAvailable() || sdk.noIdentityAvailable() === undefined ? 'yes' : 'no'
sdk.isLoginRequired() || sdk.isLoginRequired() === undefined ? 'yes' : 'no'
);
$(`#has_opted_out`).text(sdk.hasOptedOut() ? 'yes' : 'no');
$('#update_counter').text(callbackCounter);
Expand All @@ -37,7 +37,7 @@
}

function updateSharedGuiElements() {
if (getUidSdk().noIdentityAvailable()) {
if (getUidSdk().isLoginRequired()) {
$('#login_form').show();
$('#logout_form').hide();
} else {
Expand All @@ -63,11 +63,10 @@
});

$('#login').click(async () => {
//const email = $('#email').val();
const phone = $('#email').val();
const email = $('#email').val();

try {
await getUidSdk().setIdentityFromPhoneHash(phone, clientSideIdentityOptions);
await getUidSdk().setIdentityFromEmail(email, clientSideIdentityOptions);
} catch (e) {
console.error('setIdentityFromEmail failed', e);
}
Expand Down
7 changes: 1 addition & 6 deletions src/sdkBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export abstract class SdkBase {
/**
* @deprecated in version 3.9.0. Use noIdentityAvailable() instead
*/
public noIdentityAvailable() {
public isLoginRequired() {
return this.noIdentityAvailable();
}

Expand All @@ -193,11 +193,6 @@ export abstract class SdkBase {
return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests());
}

// public hasIdentity() {
// if (!this._initComplete) return undefined;
// return !(this.isLoggedIn() || this._apiClient?.hasActiveRequests());
// }

public hasOptedOut() {
if (!this._initComplete) return undefined;
return isOptoutIdentity(this._identity);
Expand Down

0 comments on commit 41209bf

Please sign in to comment.