Added api key as dependency

This commit is contained in:
Lucas Oliveira 2023-11-16 22:32:02 -03:00
commit 844e7127af

View file

@ -17,6 +17,7 @@ import {
SelectValue, SelectValue,
} from "../../components/ui/select"; } from "../../components/ui/select";
import { alertContext } from "../../contexts/alertContext"; import { alertContext } from "../../contexts/alertContext";
import { AuthContext } from "../../contexts/authContext";
import { StoreContext } from "../../contexts/storeContext"; import { StoreContext } from "../../contexts/storeContext";
import { getStoreComponents, getStoreTags } from "../../controllers/API"; import { getStoreComponents, getStoreTags } from "../../controllers/API";
import StoreApiKeyModal from "../../modals/StoreApiKeyModal"; import StoreApiKeyModal from "../../modals/StoreApiKeyModal";
@ -25,6 +26,7 @@ import { cn } from "../../utils/utils";
export default function StorePage(): JSX.Element { export default function StorePage(): JSX.Element {
const { validApiKey, setValidApiKey, hasApiKey, loadingApiKey } = const { validApiKey, setValidApiKey, hasApiKey, loadingApiKey } =
useContext(StoreContext); useContext(StoreContext);
const { apiKey } = useContext(AuthContext);
const { setErrorData } = useContext(alertContext); const { setErrorData } = useContext(alertContext);
const [loading, setLoading] = useState(true); const [loading, setLoading] = useState(true);
const [loadingTags, setLoadingTags] = useState(true); const [loadingTags, setLoadingTags] = useState(true);
@ -75,6 +77,7 @@ export default function StorePage(): JSX.Element {
selectFilter, selectFilter,
validApiKey, validApiKey,
hasApiKey, hasApiKey,
apiKey,
]); ]);
function handleGetTags() { function handleGetTags() {