From 2d5efdc9205b866d78f3a402dc2ebe8f613f9071 Mon Sep 17 00:00:00 2001 From: psjostrom Date: Wed, 2 Dec 2020 09:16:35 +0100 Subject: [PATCH] SDA-2710 Changes after code review --- src/app/screen-snippet-handler.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/screen-snippet-handler.ts b/src/app/screen-snippet-handler.ts index 76dabb35..0f2d839f 100644 --- a/src/app/screen-snippet-handler.ts +++ b/src/app/screen-snippet-handler.ts @@ -296,20 +296,19 @@ class ScreenSnippet { data, type, }; - this.deleteFile(snippetData.screenSnippetPath); logger.info( `screen-snippet-handler: Snippet captured! Sending data to SFE`, ); webContents.send('screen-snippet-data', payload); await this.verifyAndUpdateAlwaysOnTop(); - } - catch (error) { + } catch (error) { await this.verifyAndUpdateAlwaysOnTop(); logger.error( `screen-snippet-handler: screen capture failed with error: ${error}!`, ); + } finally { + this.deleteFile(snippetData.screenSnippetPath); } - }); } }