Skip to content

Commit

Permalink
🚨 Fix linter warning
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Jul 20, 2024
1 parent edff277 commit 7f0d8d4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/components/authcore-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ export const AuthcoreDialog: FC<AuthcoreDialogProps> = ({
/>
</svg>

<p><FormattedMessage id="wallet_connect_hint_browser_warning" /></p>
<p>
<FormattedMessage id="wallet_connect_hint_browser_warning" />
</p>
{isHideSocialLogin && (
<p><FormattedMessage id="wallet_connect_hint_reset_password" /></p>
<p>
<FormattedMessage id="wallet_connect_hint_reset_password" />
</p>
)}
</div>
</aside>
Expand Down
17 changes: 13 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export class LikeCoinWalletConnector {
: true,

language: options.language || 'en',
authcoreClientId: options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT,
authcoreClientId:
options.authcoreClientId || SOCIAL_LOGIN_OPTIONS.DEFAULT,
authcoreApiHost: options.authcoreApiHost || 'https://authcore.like.co',
authcoreRedirectUrl: options.authcoreRedirectUrl || '',

Expand Down Expand Up @@ -371,9 +372,14 @@ export class LikeCoinWalletConnector {
<AuthcoreDialog
onMount={({ containerId }) => {
const intervalId = setInterval(() => {
const containerElement = document.getElementById(containerId);
const containerElement = document.getElementById(
containerId
);
if (containerElement) {
initAuthcore(this.options, { containerId, initialScreen });
initAuthcore(this.options, {
containerId,
initialScreen,
});
clearInterval(intervalId);
}
}, 200);
Expand All @@ -394,7 +400,10 @@ export class LikeCoinWalletConnector {
);
});
} else {
initiator = initAuthcore(this.options, { accessToken, initialScreen });
initiator = initAuthcore(this.options, {
accessToken,
initialScreen,
});
}
break;

Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export type LikeCoinWalletConnectorEvent =
method: LikeCoinWalletConnectorMethodType;
};

export type AuthCoreInitialScreen = 'signin' | 'register'
export type AuthCoreInitialScreen = 'signin' | 'register';

export interface LikeCoinWalletConnectorConfig {
chainId: string;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/authcore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AuthCoreAuthClient, AuthCoreWidgets } from '@likecoin/authcore-js';
import {
LikeCoinWalletConnectorInitResponse,
LikeCoinWalletConnectorOptions,
AuthCoreInitialScreen
AuthCoreInitialScreen,
} from '../types';
import { convertAddressPrefix } from './wallet';

Expand All @@ -32,7 +32,7 @@ export async function initAuthcore(
accessToken?: string;
containerId?: string;
initialScreen?: AuthCoreInitialScreen;
} = {},
} = {}
): Promise<LikeCoinWalletConnectorInitResponse> {
const authcoreApiHost = options.authcoreApiHost;

Expand Down

0 comments on commit 7f0d8d4

Please sign in to comment.