1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 08:58:30 -04:00

fix component effects

This commit is contained in:
Jake Jarvis 2021-12-16 12:14:37 -05:00
parent 65d413ca8c
commit 7fbdf16573
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ const Counter = (props) => {
// start fetching hits from API once slug is set
useEffect(() => {
return fetch(`/api/hits/?slug=${encodeURIComponent(props.slug)}`)
fetch(`/api/hits/?slug=${encodeURIComponent(props.slug)}`)
.then((response) => response.json())
.then((data) => setHits(data.hits || 0));
}, [props.slug]);

View File

@ -12,7 +12,7 @@ const RepositoryGrid = () => {
// start fetching repos from API immediately
useEffect(() => {
// API endpoint (sort by stars, limit to 12)
return fetch("/api/projects/?top&limit=12")
fetch("/api/projects/?top&limit=12")
.then((response) => response.json())
.then((data) => setRepos(data || []));
}, []);

View File

@ -11,7 +11,7 @@ const ThemeToggle = () => {
const [dark, setDark] = useState(isDark());
const [saved, setSaved] = useState(!!getDarkPref());
// real-time switching between modes based on system if preference isn't set (and it's supported by OS/browser)
// real-time switching between modes based on user's system if preference isn't set (and it's supported by OS/browser)
const matchCallback = useCallback((e) => setDark(e.matches), []);
useEffect(() => {
try {