SDA-2571 Fixed triggering multiple BI calls

This commit is contained in:
psjostrom 2020-12-18 12:01:31 +01:00
parent 82d8dd8479
commit d84d54239c
2 changed files with 4 additions and 12 deletions

View File

@ -52,6 +52,10 @@ class ScreenSnippet {
if (isLinux) {
this.captureUtil = '/usr/bin/gnome-screenshot';
}
ipcMain.on('send-tracking-data-to-main', async (_event, eventData: { element: AnalyticsElements, type: ScreenSnippetActionTypes }) => {
analytics.track({ element: eventData.element, action_type: eventData.type });
});
}
/**
@ -116,7 +120,6 @@ class ScreenSnippet {
windowHandler.closeSnippingToolWindow();
windowHandler.createSnippingToolWindow(this.outputFilePath, dimensions);
this.uploadSnippet(webContents);
this.sendAnalytics();
return;
}
const {
@ -287,16 +290,6 @@ class ScreenSnippet {
}
});
}
/**
* Send analytics data to analytics module
*/
private sendAnalytics() {
ipcMain.on('send-tracking-data-to-main', async (_event, eventData: { element: AnalyticsElements, type: ScreenSnippetActionTypes }) => {
analytics.track({element: eventData.element, action_type: eventData.type});
});
}
}
const screenSnippet = new ScreenSnippet();

View File

@ -1021,7 +1021,6 @@ export class WindowHandler {
const scaleFactor = display.scaleFactor;
const scaledImageDimensions = { height: Math.floor(snipDimensions.height / scaleFactor), width: Math.floor(snipDimensions.width / scaleFactor) };
logger.info('window-handler, createSnippingToolWindow: Image will open with scaled dimensions: ' + JSON.stringify(scaledImageDimensions));
// const scaledImageDimensions = snipDimensions;
const annotateAreaHeight = scaledImageDimensions.height > availableAnnotateAreaHeight ?
availableAnnotateAreaHeight :