Skip to content

Commit

Permalink
fix googl
Browse files Browse the repository at this point in the history
  • Loading branch information
KamyarTaher committed Aug 4, 2024
1 parent cdb999b commit 19f32c6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 27 deletions.
3 changes: 0 additions & 3 deletions src/app/backendAPI/backendAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export const postConnectGoogle = (credential: string) =>
.json();

export async function getRewardAddress() {
console.log("accestoken", accessToken);

return api
.get("profile/address", {
headers: {
Expand All @@ -50,7 +48,6 @@ export async function getRewardAddress() {
}

export async function setRewardAddressBAPI(address: string) {
console.log("setttersend", accessToken, address);
return api
.post("profile/address", {
json: { address },
Expand Down
37 changes: 14 additions & 23 deletions src/app/components/NavigationBar/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export function LoginButton({
getRefresh(false)
.then((data: any) => {
setPublicKeyFromCookies(data?.playerData?.publicKey);
console.log(data, " refreshfalse");
if (data?.accessToken) setAccessToken(data?.accessToken);
})
.catch((err) => console.log(err));
Expand All @@ -52,7 +51,6 @@ export function LoginButton({
getRefresh(true)
.then((data: any) => {
setPublicKeyFromCookies(data?.playerData?.publicKey);
console.log(data);
setInitialStates(data);
})
.catch((err) => console.log(err))
Expand Down Expand Up @@ -97,31 +95,25 @@ export function LoginButton({
[handleClose]
);

const handleWalletConnect = useCallback(
() =>
connectToStarknet()
.then((data: any) => {
SAG.setIsAuthLoading(true);
if (data) setInitialStates(data);
})
.catch((err) => console.log(err))
.finally(() => {
SAG.setIsAuthLoading(false);
handleClose();
}),
[handleAuth]
);
const handleWalletConnect = useCallback(() => {
SAG.setIsAuthLoading(true);

return connectToStarknet()
.then((data: any) => {
if (data) setInitialStates(data);
})
.catch((err) => console.log(err))
.finally(() => {
SAG.setIsAuthLoading(false);
handleClose();
});
}, [handleAuth]);

const handleGoogleLogin = useCallback(
(credentialResponse: { credential: string }) => {
SAG.setIsAuthLoading(true);
postConnectGoogle(credentialResponse?.credential)
.then((data: any) => {
console.log("wertwert", data);
if (data) setInitialStates(data);
})
return postConnectGoogle(credentialResponse?.credential)
.then((data: any) => {
console.log("waééetutils", data);
if (data) setInitialStates(data);
})
.catch((err) => console.log(err))
Expand Down Expand Up @@ -183,7 +175,6 @@ export function LoginButton({

function setInitialStates(authData: any) {
SAG.setIsConnected(true);
console.log("initial states", authData);
const pb = authData?.playerData?.publicKey;
setAccessToken(authData?.accessToken);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function LinkWallet() {
useEffect(() => {
getRewardAddress()
.then((rewardAddress: any) => {
console.log(rewardAddress);
const fRewardAddress = `0x${rewardAddress?.address}`;
setRewardAddress(fRewardAddress);
})
Expand Down

0 comments on commit 19f32c6

Please sign in to comment.