Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/components/home/CodingNews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ export default function CodingNews() {
throw new Error('Failed to fetch news');
}
const data = await response.json();
setNews(data);
if (Array.isArray(data)) {
setNews(data as NewsItem[]);
} else if (data && Array.isArray(data.articles)) {
setNews(data.articles as NewsItem[]);
} else {
setNews(FALLBACK_NEWS);
}
} catch (err) {
console.error('Error fetching news:', err);
// Fall back gracefully even if fetch fails
Expand Down
5 changes: 3 additions & 2 deletions src/components/ui/InteractiveBackground.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use client';
const DEVPATH_API =
process.env.NEXT_PUBLIC_DEVPATH_API_URL ?? 'https://api.devpath.in';
import { useEffect, useRef } from 'react';
import { useUIStore } from '@/stores/ui-store';

const DEVPATH_API =
process.env.NEXT_PUBLIC_DEVPATH_API_URL ?? 'https://api.devpath.in';

// Code snippets that type across the screen — dev/community themed
const CODE_LINES = [
// Git
Expand Down
3 changes: 2 additions & 1 deletion src/context/RealTimeContext.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
'use client';
import React, { createContext, useContext, useState, useEffect } from 'react';

const AVATAR_API =
process.env.NEXT_PUBLIC_AVATAR_API_URL ??
'https://api.dicebear.com/7.x/avataaars/svg';
import React, { createContext, useContext, useState, useEffect } from 'react';

interface Activity {
id: number;
Expand Down
Loading