Skip to content

Commit 7543b2a

Browse files
committed
fix: update journal post text and refactor URL handling in journal viewer
1 parent 6c83b03 commit 7543b2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exercises/99.final/99.solution/app/routes/ui/journal-viewer.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ function XPostLinkImpl({ entryCount }: { entryCount: number }) {
113113
const handlePostOnX = () => {
114114
startTransition(async () => {
115115
try {
116-
const text = `I have ${entryCount} journal ${entryCount === 1 ? 'entry' : 'entries'} in my personal journal app! 📝✨`
117-
const url = `https://x.com/intent/post?text=${encodeURIComponent(text)}`
116+
const text = `I have ${entryCount} journal ${entryCount === 1 ? 'entry' : 'entries'} in my EpicMe journal! 📝✨`
117+
const url = new URL('https://x.com/intent/post')
118+
url.searchParams.set('text', text)
118119

119-
await navigateToLink(url)
120+
await navigateToLink(url.toString())
120121
} catch (err) {
121122
showBoundary(err)
122123
}

0 commit comments

Comments
 (0)