Skip to content

Commit

Permalink
fixed kyc
Browse files Browse the repository at this point in the history
  • Loading branch information
ferso committed Nov 25, 2024
1 parent b64eb82 commit 826234e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 23 deletions.
6 changes: 0 additions & 6 deletions src/assets/.ic-assets.json

This file was deleted.

2 changes: 0 additions & 2 deletions src/assets/.well-known/ic-domains

This file was deleted.

4 changes: 2 additions & 2 deletions src/lib/dash/interface/screens/home/home.screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
import { KycStatus, useHomeScreenHook } from "./hooks/home.screen.hook";
export const HomeScreen = () => {
const hook = useHomeScreenHook();
console.log({ status: hook.account?.kyc?.statu });
console.log({ status: hook.account?.kyc?.status });
return (
<MainLayout
alert={
Expand Down Expand Up @@ -91,7 +91,7 @@ export const HomeScreen = () => {
variant="outlined"
color="secondary"
fullWidth
onClick={() => hook.onShowTransfer()}
onClick={() => {}}
>
Transfer
</Button>
Expand Down
29 changes: 16 additions & 13 deletions src/lib/dash/interface/screens/home/hooks/home.screen.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AuthContext } from "@auth/interface/providers/auth.provider";
import { KycVerifier } from "@shared/infra/utils/kyc/kyc.";
import { SellTokensService } from "@transactions/application/sell-tokens.service";

import { AccountAdapter } from "@dash/data/account.adapter";
import { NotificationContext } from "@shared/providers/notification.provider";
import { SocketContext } from "@shared/providers/socket-provider";
import { TransactionAdapter } from "@transactions/data/transactions/transactions.adapter";
Expand Down Expand Up @@ -72,13 +71,13 @@ export const useHomeScreenHook = () => {
});
};

const getWallets = async () => {
const adapter = new AccountAdapter();
let { data } = await adapter.getWallets();
if (data) {
setWallets(data);
}
};
// const getWallets = async () => {
// const adapter = new AccountAdapter();
// let { data } = await adapter.getWallets();
// if (data) {
// setWallets(data);
// }
// };

const getDestinationAccounts = () => {
setDestinationAccounts(destination_accounts);
Expand Down Expand Up @@ -146,17 +145,21 @@ export const useHomeScreenHook = () => {
};

const onNewIncome = async (data: any) => {
await getWallets();
useInfoAlert({
await getAccount();
useSuccessAlert({
message: data.reason,
});
};

const listenToEvents = () => {
socketChannel?.bind("balance-updated", (data: any) => {
onNewIncome(data);
const onKycCompleted = async (_: any) => {
useInfoAlert({
message: "Your KYC has been completed",
});
};

const listenToEvents = () => {
socketChannel?.bind("kyc-completed", onKycCompleted);
socketChannel?.bind("balance-updated", onNewIncome);
setListeningEvents(true);
};

Expand Down

0 comments on commit 826234e

Please sign in to comment.