Initial Commit
linter / quality (push) Canceled after 0s
tests / ci (8.3) (push) Canceled after 0s
tests / ci (8.4) (push) Canceled after 0s
tests / ci (8.5) (push) Canceled after 0s

This commit is contained in:
2026-08-28 23:53:45 +10:00
parent 3ce70b3701
commit 37ff8e0a88
13 changed files with 292 additions and 23 deletions
@@ -6,6 +6,9 @@ import type { StoryDetail } from '@/types/dredge.types';
const props = defineProps<{
username: string;
// When set, opens this specific (possibly expired) story item directly
// instead of the user's current live tray.
itemId?: string;
}>();
const emit = defineEmits<{
@@ -30,12 +33,15 @@ async function fetchStory() {
loading.value = true;
error.value = null;
try {
const response = await fetch(`/api/stories/${props.username}`);
const url = props.itemId ? `/api/story-items/${props.itemId}` : `/api/stories/${props.username}`;
const response = await fetch(url);
if (!response.ok) throw new Error('Failed to load story');
detail.value = await response.json();
currentIndex.value = detail.value?.start_index ?? 0;
} catch (e) {
error.value = 'Could not load this story.';
error.value = props.itemId
? 'This story is no longer available.'
: 'Could not load this story.';
} finally {
loading.value = false;
}