Skip to content

Commit

Permalink
handled redirection
Browse files Browse the repository at this point in the history
  • Loading branch information
Leanstix committed Sep 3, 2024
1 parent 59cf67d commit 745976b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/accountDetails/components/accountDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import React, { useEffect, useState } from 'react';
import axios from 'axios'; // Import Axios
import img from "@/public/woman1.png";
import Image from "next/image";
import { useRouter } from 'next/navigation';

export default function GetBankDropdown() {
const router = useRouter(); // Initialize useRouter

// State to store fetched bank data
const [banks, setBanks] = useState([]);
const [loading, setLoading] = useState(true);
Expand All @@ -18,7 +15,7 @@ export default function GetBankDropdown() {
const [accountName, setAccountName] = useState(''); // State to store verified account name
const [token, setToken] = useState(''); // State to store the extracted token

// useEffect to extract token from URL when redirected to the app
// Extract token from URL when redirected to the app
useEffect(() => {
const extractTokenFromURL = () => {
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -39,7 +36,7 @@ export default function GetBankDropdown() {
}
}, [token]);

// useEffect to fetch bank data when the token is available
// Fetch bank data when the token is available
useEffect(() => {
if (!token) return; // Only fetch if the token is available

Expand Down

0 comments on commit 745976b

Please sign in to comment.