Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kondaurovDev committed Dec 22, 2024
1 parent 7e9d40f commit 8019751
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/telegram-bot-playground/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<title>Telegram Bot Playground</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<script defer src="https://cdn.jsdelivr.net/npm/@monaco-editor/[email protected]/lib/umd/monaco-loader.min.js"></script>
<script defer src="./scripts/init.js?v=79sgsn" type="module"></script>
<script defer src="./scripts/init.js?v=qp2taj" type="module"></script>
<script defer src="./scripts/main.js?v=bgip" type="module"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>

<link rel="stylesheet" href="styles.css?v=oq5lin">
</head>

<body
<body
x-data="{
selected_example: 'empty.ts',
botUpdates: [],
Expand Down
2 changes: 1 addition & 1 deletion docs/telegram-bot-playground/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"styles.css": "oq5lin",
"init.js": "79sgsn",
"init.js": "qp2taj",
"main.js": "bgip",
"web-worker.js": "7hqmn5"
}
5 changes: 2 additions & 3 deletions docs/telegram-bot-playground/scripts/init.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// src/tg-bot-playground/init.ts
window.playground = {};
console.log("initiating...");
var version = await fetch("./metadata.json", { cache: "no-cache" }).then((_) => _.json()).then((_) => _["web-worker.js"]);
if (version) {
const worker = new Worker(`./scripts/web-worker.js?v=${version}`, { type: "module" });
worker.addEventListener("message", (msg) => {
console.log("From worker", msg.data);
});
window.playground.worker = worker;
console.log("web worker has been loaded");
} else {
console.warn("web worker not initiated");
}
Expand Down
7 changes: 2 additions & 5 deletions src/tg-bot-playground/init.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
window.playground = {};

console.log("initiating...")
const version: string = await (
fetch("./metadata.json", { cache: "no-cache" }).then(_ => _.json()).then(_ => _["web-worker.js"])
);

if (version) {
const worker = new Worker(`./scripts/web-worker.js?v=${version}`, { type: "module" });

worker.addEventListener("message", msg => {
console.log("From worker", msg.data);
});

window.playground.worker = worker;
console.log("web worker has been loaded")
} else {
console.warn("web worker not initiated")
}
Expand Down

0 comments on commit 8019751

Please sign in to comment.