Skip to content

Commit

Permalink
chore: update code
Browse files Browse the repository at this point in the history
  • Loading branch information
camewell071 committed Jan 12, 2024
1 parent 393aae6 commit 293a89f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Providers/unisat-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const UnisatProvider: React.FC<PropsWithChildren> = ({
}: PropsWithChildren): React.ReactElement => {

const checkUnisatInstalled = () => {
const installed = !!window.unisat;
const installed = !!(window as any)?.unisat;
if (!installed) {
window.open('https://unisat.io/download', '_blank');
}
Expand All @@ -28,7 +28,7 @@ export const UnisatProvider: React.FC<PropsWithChildren> = ({

const onConnect = async () => {
try {
const unisat = window.unisat;
const unisat = (window as any)?.unisat;
const installed = checkUnisatInstalled();
if (!installed) return;
await unisat.requestAccounts();
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/xverse-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const XVerseProvider: React.FC<PropsWithChildren> = ({
while (runs < MAX_RUNS) {
try {
await getCapabilities({
onFinish(response) {
onFinish(response: any) {
setCapabilities(new Set(response));
setCapabilityState('loaded');
},
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const useConnect = () => {
await onConnect(type);
switch (type) {
case WalletType.unisat: {
const unisat = window.unisat;
const unisat = (window as any)?.unisat;
if (unisat) {
const accounts = await unisat.getAccounts();
if (!!accounts.length) {
Expand Down

0 comments on commit 293a89f

Please sign in to comment.