From 45a2cd0ab21ca9752153597af6b3f02710ad35f6 Mon Sep 17 00:00:00 2001 From: dessant Date: Sat, 6 Aug 2022 17:56:11 +0300 Subject: [PATCH] fix: update trace.moe --- src/engines/whatanime.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/engines/whatanime.js b/src/engines/whatanime.js index 98088b35..f549273d 100644 --- a/src/engines/whatanime.js +++ b/src/engines/whatanime.js @@ -1,19 +1,17 @@ import {findNode} from 'utils/common'; -import {initSearch, sendReceipt} from 'utils/engines'; -import {convertImage} from 'utils/app'; +import {setFileInputData, initSearch, sendReceipt} from 'utils/engines'; const engine = 'whatanime'; async function search({session, search, image, storageIds}) { - const convImageDataUrl = await convertImage(image.imageDataUrl, { - type: 'image/jpeg', - maxSize: 640 - }); + const inputSelector = 'input[type=file]'; + const input = await findNode(inputSelector); + + await setFileInputData(inputSelector, input, image); await sendReceipt(storageIds); - (await findNode('#autoSearch')).checked = true; - (await findNode('#originalImage')).src = convImageDataUrl; + input.dispatchEvent(new Event('change', {bubbles: true})); } function init() {