From 36c028e8eb9f545df7d6c253382290b81ef5c93f Mon Sep 17 00:00:00 2001 From: dessant Date: Sat, 6 Aug 2022 12:53:26 +0300 Subject: [PATCH] fix: update TMview --- src/engines/tmview.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engines/tmview.js b/src/engines/tmview.js index 6a30bfc6..9e96a6a6 100644 --- a/src/engines/tmview.js +++ b/src/engines/tmview.js @@ -5,10 +5,11 @@ const engine = 'tmview'; async function search({session, search, image, storageIds}) { // previous search may be cached + let removeImage = true; processNode( '.image-remove button', function (node) { - if (node && !document.querySelector('.area-selection')) { + if (node && removeImage) { node.click(); } }, @@ -18,11 +19,12 @@ async function search({session, search, image, storageIds}) { const inputSelector = 'input[type=file]'; const input = await findNode(inputSelector); + removeImage = false; await setFileInputData(inputSelector, input, image); input.dispatchEvent(new Event('change', {bubbles: true})); - await findNode('.image-tools'); + await findNode('.image-remove button'); await sendReceipt(storageIds);