Skip to content

Commit

Permalink
fix: update TMview
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Aug 6, 2022
1 parent 49a0897 commit 36c028e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/engines/tmview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
},
Expand All @@ -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);

Expand Down

0 comments on commit 36c028e

Please sign in to comment.