Merge branch 'pending_changes' into dev_environment

This commit is contained in:
Carter 2026-06-24 14:40:10 -06:00
commit 2992121744

View file

@ -72,6 +72,7 @@ interface Props {
interface PendingInteraction { interface PendingInteraction {
since: string; since: string;
seenUnsynced: boolean;
accepted: boolean; accepted: boolean;
} }
@ -110,10 +111,13 @@ export default function InteractionsOverview(props: Props) {
if (!existing || existing.accepted) { if (!existing || existing.accepted) {
updatedPending.set(interaction.key(), { updatedPending.set(interaction.key(), {
since: interaction.status.lastUpdate || moment().toISOString(), since: interaction.status.lastUpdate || moment().toISOString(),
seenUnsynced: true,
accepted: false accepted: false
}); });
} else if (!existing.seenUnsynced) {
updatedPending.set(interaction.key(), { ...existing, seenUnsynced: true });
} }
} else if (existing && !existing.accepted) { } else if (existing && existing.seenUnsynced && !existing.accepted) {
updatedPending.set(interaction.key(), { ...existing, accepted: true }); updatedPending.set(interaction.key(), { ...existing, accepted: true });
} }
}); });
@ -229,7 +233,7 @@ export default function InteractionsOverview(props: Props) {
setPendingInteractions((prevPending) => { setPendingInteractions((prevPending) => {
const updatedPending = new Map(prevPending); const updatedPending = new Map(prevPending);
if (interactionKey) { if (interactionKey) {
updatedPending.set(interactionKey, { since: moment().toISOString(), accepted: false }); updatedPending.set(interactionKey, { since: moment().toISOString(), seenUnsynced: false, accepted: false });
} }
return updatedPending; return updatedPending;
}); });