fix: always show skeletons for reads/links when no data

Removed empty state messages like "No articles in your reads" and
"No links yet" - now just show loading skeletons until data arrives.

This is simpler and prevents showing empty states while data is still
being fetched in the background.

Users will only see:
- Skeletons when no data (loading or truly empty)
- "No articles/links match this filter" when filtered out
- Actual content when data is available
This commit is contained in:
Gigi
2025-10-16 01:40:37 +02:00
parent 1e8e58fa05
commit 5bb81b3c22

View File

@@ -449,8 +449,8 @@ const Me: React.FC<MeProps> = ({ relayPool, activeTab: propActiveTab, pubkey: pr
)
case 'reads':
// Show loading skeletons while fetching reads
if (loading && reads.length === 0) {
// Show loading skeletons while fetching reads or if no data yet
if (reads.length === 0) {
return (
<div className="explore-grid">
{Array.from({ length: 6 }).map((_, i) => (
@@ -460,15 +460,6 @@ const Me: React.FC<MeProps> = ({ relayPool, activeTab: propActiveTab, pubkey: pr
)
}
// No reads at all
if (reads.length === 0) {
return (
<div className="explore-loading" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '4rem', color: 'var(--text-secondary)' }}>
No articles in your reads.
</div>
)
}
// Show reads with filters
return (
<>
@@ -496,8 +487,8 @@ const Me: React.FC<MeProps> = ({ relayPool, activeTab: propActiveTab, pubkey: pr
)
case 'links':
// Show loading skeletons while fetching links
if (loading && links.length === 0) {
// Show loading skeletons while fetching links or if no data yet
if (links.length === 0) {
return (
<div className="explore-grid">
{Array.from({ length: 6 }).map((_, i) => (
@@ -507,15 +498,6 @@ const Me: React.FC<MeProps> = ({ relayPool, activeTab: propActiveTab, pubkey: pr
)
}
// No links at all
if (links.length === 0) {
return (
<div className="explore-loading" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', padding: '4rem', color: 'var(--text-secondary)' }}>
No links yet.
</div>
)
}
// Show links with filters
return (
<>