Skip to content

Commit 3b063e4

Browse files
committed
fix(ops): resolve sendingDigest state variable and MasterCalendarEvent field names
1 parent 22e7254 commit 3b063e4

1 file changed

Lines changed: 21 additions & 16 deletions

File tree

‎apps/ops/src/App.tsx‎

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,7 @@ export function App() {
10671067
<button
10681068
type="button"
10691069
onClick={handleSendDailyDigestEmail}
1070-
disabled={sendingDailyDigest}
1070+
disabled={sendingDigest}
10711071
style={{
10721072
...btnStyle,
10731073
padding: "8px 12px",
@@ -1078,7 +1078,7 @@ export function App() {
10781078
}}
10791079
title="Email Today's Action Queue & Ongoing Schedule to alex@codingcat.dev"
10801080
>
1081-
{sendingDailyDigest
1081+
{sendingDigest
10821082
? "📧 Sending Digest..."
10831083
: "📧 Email Today's Digest"}
10841084
</button>
@@ -1139,7 +1139,7 @@ export function App() {
11391139
<button
11401140
type="button"
11411141
onClick={handleSendDailyDigestEmail}
1142-
disabled={sendingDailyDigest}
1142+
disabled={sendingDigest}
11431143
style={{
11441144
...btnStyle,
11451145
background: "#1d4ed8",
@@ -1148,7 +1148,7 @@ export function App() {
11481148
fontWeight: 700,
11491149
}}
11501150
>
1151-
{sendingDailyDigest
1151+
{sendingDigest
11521152
? "📧 Sending Digest to alex@codingcat.dev..."
11531153
: "📧 Email Today's Action Digest Now"}
11541154
</button>
@@ -1471,32 +1471,37 @@ export function App() {
14711471

14721472
const bookingEventIds = new Set(
14731473
bookings
1474-
.map((b) => b.calendarEventId)
1474+
.flatMap((b) => [
1475+
b.googleCalendarEventId,
1476+
`alex@codingcat.dev:${b.googleCalendarEventId}`,
1477+
])
14751478
.filter(Boolean),
14761479
);
14771480

14781481
const externalEvents = masterCalendarEvents
1479-
.filter(
1480-
(ev) =>
1482+
.filter((ev) => {
1483+
const title = ev.title || "";
1484+
return (
14811485
!bookingEventIds.has(ev.id) &&
1482-
!ev.summary.startsWith("[CodingCat.dev]") &&
1483-
!ev.summary.startsWith("CodingCat.dev Podcast") &&
1484-
!ev.summary.startsWith(
1486+
!title.startsWith("[CodingCat.dev]") &&
1487+
!title.startsWith("CodingCat.dev Podcast") &&
1488+
!title.startsWith(
14851489
"[HOLD] CodingCat.dev Podcast",
14861490
) &&
1487-
Date.parse(ev.start) >= nowMs,
1488-
)
1491+
Date.parse(ev.startAt) >= nowMs
1492+
);
1493+
})
14891494
.map((ev) => ({
1490-
id: `${ev.calendarId}:${ev.id}`,
1491-
startAt: ev.start,
1495+
id: ev.id,
1496+
startAt: ev.startAt,
14921497
calendarLabel:
14931498
ev.calendarId === "alex.patterson@sanity.io"
14941499
? "🟧 alex.patterson@sanity.io"
14951500
: "🟪 alex@codingcat.dev",
1496-
title: ev.summary,
1501+
title: ev.title || "(Busy)",
14971502
status: ev.visibility === "private" ? "private" : "busy",
14981503
streamyardUrl: ev.htmlLink || "",
1499-
booking: null as PodcastBooking | null,
1504+
booking: null as BookingDoc | null,
15001505
}));
15011506

15021507
const combined = [...bookingEvents, ...externalEvents].sort(

0 commit comments

Comments
 (0)