1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-06-29 21:05:59 -04:00

fix component effects

This commit is contained in:
2021-12-16 12:14:37 -05:00
parent 65d413ca8c
commit 7fbdf16573
3 changed files with 3 additions and 3 deletions
+1 -1
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]);
+1 -1
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 || []));
}, []);
+1 -1
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 {