mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: removing sentry
This commit is contained in:
parent
59b1f2d5a5
commit
dc7591ee28
77 changed files with 161 additions and 7545 deletions
|
|
@ -4,13 +4,11 @@ import parseTorrent from "parse-torrent";
|
|||
const port = parentPort;
|
||||
if (!port) throw new Error("IllegalState");
|
||||
|
||||
export const getFileBuffer = async (url: string) =>
|
||||
fetch(url, { method: "GET" }).then((response) =>
|
||||
response.arrayBuffer().then((buffer) => Buffer.from(buffer))
|
||||
);
|
||||
|
||||
port.on("message", async (url: string) => {
|
||||
const buffer = await getFileBuffer(url);
|
||||
const torrent = await parseTorrent(buffer);
|
||||
port.postMessage(torrent);
|
||||
port.on("message", async (buffer: Buffer) => {
|
||||
try {
|
||||
const torrent = await parseTorrent(buffer);
|
||||
port.postMessage(torrent);
|
||||
} catch (err) {
|
||||
port.postMessage(null);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue