Skip to content

Commit

Permalink
fix: CORS error when fetching from google fonts
Browse files Browse the repository at this point in the history
Removed prefetch for the entire gstatic.com site. Only preload Lilita
font and added extra link in index.html: one to preload as style and
the other is a rel="stylesheet."
  • Loading branch information
Hallelujah78 committed Mar 22, 2024
1 parent ff85c66 commit ec35675
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@

<head>
<meta charset="UTF-8" />
<link rel="prefetch" href="https://fonts.gstatic.com" crossorigin>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Lilita+One&display=swap" rel="stylesheet">
<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Lilita+One&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lilita+One&display=swap" rel="stylesheet">


<link href="https://fonts.googleapis.com/css2?family=Libre+Franklin:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
Expand Down
1 change: 0 additions & 1 deletion src/hooks/useLocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const useLocalStorage = <T>(

// initialize
const initialize = useRef((key: string) => {
console.log("calling initialize");
try {
const storeItem = localStorage.getItem(key);
if (storeItem !== null) {
Expand Down

0 comments on commit ec35675

Please sign in to comment.