Merge branch 'tag_fix3' into dev_environment
This commit is contained in:
commit
1eb00fd5a1
1 changed files with 0 additions and 23 deletions
|
|
@ -87,15 +87,6 @@ export default function InteractionsOverview(props: Props) {
|
||||||
undefined
|
undefined
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
console.log("[interactions:mount] initial interactions:", props.interactions.map(i => ({
|
|
||||||
key: i.key(),
|
|
||||||
synced: i.status.synced,
|
|
||||||
lastUpdate: i.status.lastUpdate,
|
|
||||||
lastSynced: i.status.lastSynced,
|
|
||||||
})));
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (components !== prevComponents) {
|
if (components !== prevComponents) {
|
||||||
let initMappedComponents: Map<string, Component> = new Map();
|
let initMappedComponents: Map<string, Component> = new Map();
|
||||||
|
|
@ -106,17 +97,6 @@ export default function InteractionsOverview(props: Props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.interactions !== prevInteractions) {
|
if (props.interactions !== prevInteractions) {
|
||||||
console.log("[interactions:effect] props.interactions changed, prevInteractions was", prevInteractions ? "defined" : "undefined");
|
|
||||||
props.interactions.forEach((interaction: Interaction) => {
|
|
||||||
const key = interaction.key();
|
|
||||||
const prevInteraction = prevInteractions?.find(p => p.key() === key);
|
|
||||||
console.log("[interactions:effect]", key, {
|
|
||||||
synced: interaction.status.synced,
|
|
||||||
lastUpdate: interaction.status.lastUpdate,
|
|
||||||
prevSynced: prevInteraction?.status.synced,
|
|
||||||
prevLastUpdate: prevInteraction?.status.lastUpdate,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
setAcceptedInteractions(prev => {
|
setAcceptedInteractions(prev => {
|
||||||
const updated = new Set(prev);
|
const updated = new Set(prev);
|
||||||
props.interactions.forEach((interaction: Interaction) => {
|
props.interactions.forEach((interaction: Interaction) => {
|
||||||
|
|
@ -125,7 +105,6 @@ export default function InteractionsOverview(props: Props) {
|
||||||
if (!interaction.status.synced) {
|
if (!interaction.status.synced) {
|
||||||
updated.delete(key);
|
updated.delete(key);
|
||||||
} else if (prevInteraction && !prevInteraction.status.synced) {
|
} else if (prevInteraction && !prevInteraction.status.synced) {
|
||||||
console.log("[interactions:effect] ACCEPTED", key);
|
|
||||||
updated.add(key);
|
updated.add(key);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -240,7 +219,6 @@ export default function InteractionsOverview(props: Props) {
|
||||||
interactionsAPI
|
interactionsAPI
|
||||||
.updateInteraction(Number(deviceID), settings, as)
|
.updateInteraction(Number(deviceID), settings, as)
|
||||||
.then((_response: any) => {
|
.then((_response: any) => {
|
||||||
console.log("[interactions:submit] API success, setting synced=false for index", index);
|
|
||||||
let updatedDirtyInteractions = cloneDeep(dirtyInteractions);
|
let updatedDirtyInteractions = cloneDeep(dirtyInteractions);
|
||||||
updatedDirtyInteractions.set(index, false);
|
updatedDirtyInteractions.set(index, false);
|
||||||
setDirtyInteractions(updatedDirtyInteractions);
|
setDirtyInteractions(updatedDirtyInteractions);
|
||||||
|
|
@ -249,7 +227,6 @@ export default function InteractionsOverview(props: Props) {
|
||||||
if (updated[index]) {
|
if (updated[index]) {
|
||||||
updated[index].status.synced = false;
|
updated[index].status.synced = false;
|
||||||
updated[index].status.lastUpdate = moment().toISOString();
|
updated[index].status.lastUpdate = moment().toISOString();
|
||||||
console.log("[interactions:submit] local state updated for", updated[index].key());
|
|
||||||
}
|
}
|
||||||
return updated;
|
return updated;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue