chore: Update translations

This commit is contained in:
2024-03-07 14:12:50 +00:00
parent 583aff433c
commit a2fe2255c8
13 changed files with 43 additions and 44 deletions

View File

@ -1,12 +1,12 @@
import { WorkerRelayInterface } from "@snort/worker-relay";
// when using Vite import the worker script directly (for production)
import WorkerVite from "@snort/worker-relay/src/worker?worker"
import WorkerVite from "@snort/worker-relay/src/worker?worker";
// in dev mode import esm module, i have no idea why it has to work like this
const workerScript = import.meta.env.DEV ?
new URL("@snort/worker-relay/dist/esm/worker.mjs", import.meta.url) :
new WorkerVite();
const workerScript = import.meta.env.DEV
? new URL("@snort/worker-relay/dist/esm/worker.mjs", import.meta.url)
: new WorkerVite();
const workerRelay = new WorkerRelayInterface(workerScript);
@ -18,11 +18,11 @@ const results = await workerRelay.query(["REQ", "1", { kinds: [1], limit: 10 }])
// publish a new event to the relay
const myEvent = {
kind: 1,
created_at: Math.floor(new Date().getTime() / 1000),
content: "test",
tags: []
kind: 1,
created_at: Math.floor(new Date().getTime() / 1000),
content: "test",
tags: [],
};
if (await workerRelay.event(myEvent)) {
console.log("Success");
}
console.log("Success");
}