grain.social is a photo sharing platform built on atproto. grain.social
atproto photography appview
54
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: back button falls back to home when no browser history

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+10 -1
+10 -1
app/lib/components/molecules/DetailHeader.svelte
··· 1 1 <script lang="ts"> 2 2 import type { Snippet } from 'svelte' 3 3 import { ArrowLeft } from 'lucide-svelte' 4 + import { goto } from '$app/navigation' 4 5 5 6 let { label, actions, onback }: { label: string; actions?: Snippet; onback?: () => void } = 6 7 $props() 8 + 9 + function goBack() { 10 + if (window.history.length > 1) { 11 + history.back() 12 + } else { 13 + goto('/') 14 + } 15 + } 7 16 </script> 8 17 9 18 <div class="detail-header"> 10 - <button class="detail-back" onclick={onback ?? (() => history.back())} 19 + <button class="detail-back" onclick={onback ?? goBack} 11 20 ><ArrowLeft size={18} /></button 12 21 > 13 22 <span class="detail-label">{label}</span>