Update page.tsx

f]h
This commit is contained in:
Legend 2024-05-17 22:29:41 -06:00 committed by GitHub
parent e0328a6428
commit 410aec5b44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,8 +13,8 @@ export default function Home() {
const [splashText, setSplashText] = useState<string>('') const [splashText, setSplashText] = useState<string>('')
useEffect(() => { useEffect(() => {
// Fetch splash text from JSON file
fetch('/splash.json') fetch('/public/splash.json')
.then(response => response.json()) .then(response => response.json())
.then(data => { .then(data => {
const randomIndex = Math.floor(Math.random() * data.length); const randomIndex = Math.floor(Math.random() * data.length);
@ -22,7 +22,6 @@ export default function Home() {
}) })
.catch(error => console.error('Error fetching splash text:', error)); .catch(error => console.error('Error fetching splash text:', error));
// Fetch shortcuts from local storage
store.set('shortcuts', [], false) store.set('shortcuts', [], false)
const data: Item[] = store('shortcuts') const data: Item[] = store('shortcuts')
setShortcuts(data) setShortcuts(data)