mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 18:15:39 +00:00
call proof generator from within a web worker
This commit is contained in:
@@ -11,11 +11,7 @@
|
||||
|
||||
import genJsonPayload from "../utils/genJsonPayload";
|
||||
import * as CONST from "./const";
|
||||
import {Work} from "./prove";
|
||||
|
||||
export type Token = {
|
||||
token: string;
|
||||
};
|
||||
import { Work, Token } from "./types";
|
||||
|
||||
export const sendWork = async (payload: Work): Promise<Token> => {
|
||||
try {
|
||||
@@ -33,7 +29,7 @@ export const sendWork = async (payload: Work): Promise<Token> => {
|
||||
} catch (err) {
|
||||
CONST.messageText().error();
|
||||
console.error(err);
|
||||
await new Promise(r => setTimeout(r, 1000));
|
||||
await new Promise((r) => setTimeout(r, 1000));
|
||||
window.location.reload();
|
||||
throw err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user