🐛 fix top-up link is null

This commit is contained in:
MartialBE 2023-12-26 23:32:27 +08:00
parent fb24d024a7
commit 002dba5a75
2 changed files with 2 additions and 2 deletions

View File

@ -1,9 +1,9 @@
import { isAdmin } from 'utils/common'; import { isAdmin } from 'utils/common';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
const navigate = useNavigate();
const useAuth = () => { const useAuth = () => {
const userIsAdmin = isAdmin(); const userIsAdmin = isAdmin();
const navigate = useNavigate();
if (!userIsAdmin) { if (!userIsAdmin) {
navigate('/panel/404'); navigate('/panel/404');

View File

@ -61,7 +61,7 @@ const TopupCard = () => {
}; };
useEffect(() => { useEffect(() => {
let status = localStorage.getItem('status'); let status = localStorage.getItem('siteInfo');
if (status) { if (status) {
status = JSON.parse(status); status = JSON.parse(status);
if (status.top_up_link) { if (status.top_up_link) {