fix auth again

This commit is contained in:
JCEEE
2026-09-28 21:13:37 +01:00
parent 89ab955efc
commit d14a154dcb
@@ -498,9 +498,7 @@
const counts: number[] = []; const counts: number[] = [];
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const d = addDays(weekStart, i); const d = addDays(weekStart, i);
counts.push( counts.push(weekCompletions.filter((c) => (c.date?.slice(0, 10) || c.date) === d).length);
weekCompletions.filter((c) => (c.date?.slice(0, 10) || c.date) === d).length
);
} }
return counts; return counts;
}); });
@@ -998,10 +996,18 @@
if (optimistic) { if (optimistic) {
famStore.applyRecord('completions', optimistic, 'delete'); famStore.applyRecord('completions', optimistic, 'delete');
} }
const msg = e instanceof Error ? e.message : String(e);
if (/CHORE_GONE/.test(msg)) {
// Drop the dead card synchronously so a second tap can't re-enter
// before the resync round-trip finishes (the repeated 400s).
famStore.applyRecord('assigned_chores', chore, 'delete');
console.error(
`[diag] toggle CHORE_GONE(drop-card) member=${memberId} fam=${famId} chore=${chore.id}`
);
}
try { try {
await famStore.resync(); await famStore.resync();
} catch {} } catch {}
const msg = e instanceof Error ? e.message : String(e);
showToast( showToast(
/CHORE_GONE/.test(msg) /CHORE_GONE/.test(msg)
? 'This chore was changed — list refreshed.' ? 'This chore was changed — list refreshed.'
@@ -1231,7 +1237,12 @@
{/if} {/if}
</Card> </Card>
<Card cols={1} title="Claims" accent={hasClaimableRewards ? '#f97316' : undefined} class={hasClaimableRewards ? 'claims-card' : ''}> <Card
cols={1}
title="Claims"
accent={hasClaimableRewards ? '#f97316' : undefined}
class={hasClaimableRewards ? 'claims-card' : ''}
>
{#if claimableRewards().length === 0} {#if claimableRewards().length === 0}
<div class="claims-empty"> <div class="claims-empty">
{@html checkCircleIcon}<span>No outstanding claims</span> {@html checkCircleIcon}<span>No outstanding claims</span>
@@ -1396,12 +1407,7 @@
{/if} {/if}
<!-- HERO --> <!-- HERO -->
<header class="hero"> <header class="hero">
<svg <svg class="hero-bg" viewBox="0 0 700 120" preserveAspectRatio="none" aria-hidden="true">
class="hero-bg"
viewBox="0 0 700 120"
preserveAspectRatio="none"
aria-hidden="true"
>
<polyline <polyline
points={heroSpark.line} points={heroSpark.line}
fill="none" fill="none"
@@ -1688,8 +1694,12 @@
{/if} {/if}
{#if inYesterday} {#if inYesterday}
<div class="yesterday-banner"> <div class="yesterday-banner">
<span>📝 Showing <b>yesterday</b> — tap anything you missed. Undo lives on today's view.</span> <span
<button class="yesterday-back" onclick={() => (viewDate = 'today')}>Back to today →</button> >📝 Showing <b>yesterday</b> — tap anything you missed. Undo lives on today's view.</span
>
<button class="yesterday-back" onclick={() => (viewDate = 'today')}
>Back to today →</button
>
</div> </div>
{/if} {/if}
<div class="kanban"> <div class="kanban">
@@ -1699,7 +1709,11 @@
<p class="empty">All done!</p> <p class="empty">All done!</p>
{:else} {:else}
{#each dailyPending as chore} {#each dailyPending as chore}
<button class="chore" onclick={() => toggle(chore)} disabled={togglingIds.has(chore.id)}> <button
class="chore"
onclick={() => toggle(chore)}
disabled={togglingIds.has(chore.id)}
>
<span class="checkbox">{@html circleIcon}</span> <span class="checkbox">{@html circleIcon}</span>
<span class="chore-name">{choreName(chore)}</span> <span class="chore-name">{choreName(chore)}</span>
<span class="chore-value">{chore.value} {chore.type}</span> <span class="chore-value">{chore.value} {chore.type}</span>
@@ -1716,7 +1730,11 @@
<p class="empty">All done!</p> <p class="empty">All done!</p>
{:else} {:else}
{#each weeklyPending as chore} {#each weeklyPending as chore}
<button class="chore" onclick={() => toggle(chore)} disabled={togglingIds.has(chore.id)}> <button
class="chore"
onclick={() => toggle(chore)}
disabled={togglingIds.has(chore.id)}
>
<span class="checkbox">{@html circleIcon}</span> <span class="checkbox">{@html circleIcon}</span>
<span class="chore-name">{choreName(chore)}</span> <span class="chore-name">{choreName(chore)}</span>
<span class="chore-value">{chore.value} {chore.type}</span> <span class="chore-value">{chore.value} {chore.type}</span>