Skip to content

Commit

Permalink
Fixed analytics bombardment on update action
Browse files Browse the repository at this point in the history
  • Loading branch information
elsoazemelet committed Jan 19, 2025
1 parent 2c7451d commit e367b12
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/renderer/runtime/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,20 @@ export async function clearElement(target: GridElement) {
}

export async function syncWithGrid(target: GridAction) {
target.sendToGrid();
target.sendToGrid().finally(() => {
const event = target.parent as GridEvent;
const element = event.parent as GridElement;
Analytics.track({
event: "Config Action",
payload: {
click: "Update",
elementType: element.type,
eventType: event.type,
short: target.short,
},
mandatory: false,
});
});
}

export async function updateAction(
Expand All @@ -205,6 +218,9 @@ export async function updateAction(
})
.catch(handleError)
.finally(() => {
if (!syncWithGrid) {
return;
}
const event = target.parent as GridEvent;
const element = event.parent as GridElement;
Analytics.track({
Expand Down

0 comments on commit e367b12

Please sign in to comment.