Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion components/watch/WatchHighlights.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ function clipsWhere() {
return where;
}

// A quiet week opens on all time rather than an empty grid.
let widenOnEmpty = true;

let requestId = 0;
async function fetchClips() {
if (props.ghost) return;
Expand All @@ -102,7 +105,14 @@ async function fetchClips() {
fetchPolicy: "network-only",
});
if (id !== requestId) return;
clips.value = ((data as any)?.match_clips ?? []) as Clip[];
const list = ((data as any)?.match_clips ?? []) as Clip[];
if (widenOnEmpty && list.length === 0 && range.value === "week") {
widenOnEmpty = false;
range.value = "all";
return;
}
widenOnEmpty = false;
clips.value = list;
} catch (error) {
console.error("[watch] highlights fetch error:", error);
} finally {
Expand Down
Loading