feat : Home page password Expiry message
feat : Statement Download
This commit is contained in:
@@ -6,6 +6,7 @@ import { IconBuildingBank, IconEye, IconLink } from '@tabler/icons-react';
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Providers } from "../../providers";
|
||||
import { notifications } from '@mantine/notifications';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
interface accountData {
|
||||
stAccountNo: string;
|
||||
@@ -26,6 +27,7 @@ export default function Home() {
|
||||
const [selectedLN, setSelectedLN] = useState(loanAccounts[0]?.stAccountNo || "");
|
||||
const selectedLNData = loanAccounts.find(acc => acc.stAccountNo === selectedLN);
|
||||
const [showBalance, setShowBalance] = useState(false);
|
||||
const PassExpiryRemains =(dayjs(localStorage.getItem("pswExpiryDate"))).diff(dayjs(),"day")
|
||||
|
||||
// If back and forward button is clicked
|
||||
useEffect(() => {
|
||||
@@ -34,19 +36,25 @@ export default function Home() {
|
||||
localStorage.removeItem("access_token");
|
||||
sessionStorage.removeItem("access_token");
|
||||
localStorage.removeItem("remitter_name");
|
||||
localStorage.removeItem("pswExpiryDate");
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
router.push("/login");
|
||||
};
|
||||
const handleBeforeUnload = () => {
|
||||
// logout on tab close / refresh
|
||||
localStorage.removeItem("access_token");
|
||||
sessionStorage.removeItem("access_token");
|
||||
localStorage.removeItem("remitter_name");
|
||||
};
|
||||
// const handleBeforeUnload = () => {
|
||||
// // logout on tab close / refresh
|
||||
// localStorage.removeItem("access_token");
|
||||
// sessionStorage.removeItem("access_token");
|
||||
// localStorage.removeItem("remitter_name");
|
||||
// localStorage.removeItem("pswExpiryDate");
|
||||
// localStorage.clear();
|
||||
// sessionStorage.clear();
|
||||
// };
|
||||
window.addEventListener("popstate", handlePopState);
|
||||
window.addEventListener("beforeunload", handleBeforeUnload);
|
||||
// window.addEventListener("beforeunload", handleBeforeUnload);
|
||||
return () => {
|
||||
window.removeEventListener("popstate", handlePopState);
|
||||
window.addEventListener("beforeunload", handleBeforeUnload);
|
||||
// window.addEventListener("beforeunload", handleBeforeUnload);
|
||||
};
|
||||
}, []);
|
||||
|
||||
@@ -229,7 +237,7 @@ export default function Home() {
|
||||
<Stack>
|
||||
<Text fw={700}> ** Book Balance includes uncleared effect.</Text>
|
||||
<Text fw={700}> ** Click on the "Show Balance"to display balance for the Deposit and Loan account.</Text>
|
||||
<Text fw={400} c="red"> ** Your Password will expire in 85 days.</Text>
|
||||
<Text fw={400} c="red"> ** Your Password will expire in {PassExpiryRemains} days.</Text>
|
||||
<Text></Text>
|
||||
</Stack>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user