Skip to content

Commit 3bb9980

Browse files
fix: add try-catch to clipboard write in TrendPredictor
1 parent 957080f commit 3bb9980

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/pages/play/TrendPredictor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default function TrendPredictor() {
8686
<Button onClick={generate} className="bg-emerald-600 hover:bg-emerald-700 text-white px-6"><Sparkles className="h-4 w-4 mr-2" />{current ? 'Predict Another' : 'Predict Trend'}</Button>
8787
{current && <>
8888
<Button onClick={generate} variant="outline" className="border-slate-600 text-slate-300 hover:bg-slate-800"><RefreshCw className="h-4 w-4 mr-2" />Refresh</Button>
89-
<Button onClick={() => navigator.clipboard.writeText(`🔥 Next viral trend: "${current.trend}"\n📊 Virality: ${current.virality}/100\n📱 Platform: ${current.platform}\n\nGet more at snapforest.in`)} variant="outline" className="border-emerald-600 text-emerald-400 hover:bg-emerald-600/10"><Share2 className="h-4 w-4 mr-2" />Share</Button>
89+
<Button onClick={async () => { try { await navigator.clipboard.writeText(`🔥 Next viral trend: "${current.trend}"\n📊 Virality: ${current.virality}/100\n📱 Platform: ${current.platform}\n\nGet more at snapforest.in`); } catch { /* ignore */ } }} variant="outline" className="border-emerald-600 text-emerald-400 hover:bg-emerald-600/10"><Share2 className="h-4 w-4 mr-2" />Share</Button>
9090
</>}
9191
</div>
9292
</Card>

0 commit comments

Comments
 (0)