Skip to content

Commit

Permalink
fix: update trace.moe
Browse files Browse the repository at this point in the history
  • Loading branch information
dessant committed Aug 6, 2022
1 parent 602dcab commit 45a2cd0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/engines/whatanime.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit 45a2cd0

Please sign in to comment.