Skip to content

Commit

Permalink
Fix loading w/ old cache (I think?)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningboltemoji committed Oct 14, 2024
1 parent 01e05b2 commit 1b51a6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ const relevant: ComputedRef<{ prev?: Tide; next?: Tide; nextFew?: Tide[] }> = co
const p = cacheV1.value.predictions.predictions;
const cur = p.findIndex((p) => dayjs.utc(p["t"]) > now.value);
if (cur < 0) {
throw "Unable to determine what tides are nearest to curren time";
console.log("Unable to determine nearest tide; waiting for fetch");
return {};
}
return {
prev: mapToTide(p[cur - 1]),
Expand Down

0 comments on commit 1b51a6c

Please sign in to comment.