Merge branch 'pending_changes' into dev_environment
This commit is contained in:
commit
2992121744
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue