41 lines
864 B
JavaScript
Executable File
41 lines
864 B
JavaScript
Executable File
"use strict";
|
|
|
|
// Import dependencies
|
|
import("/js/core.js").then(() =>
|
|
import("/js/damper.js").then(() => {
|
|
const dependencies = setInterval(() => {
|
|
if (typeof core === "function" &&
|
|
typeof core.damper === "function") {
|
|
clearInterval(dependencies);
|
|
clearTimeout(timeout);
|
|
initialization();
|
|
}
|
|
}, 10);
|
|
const timeout = setTimeout(() => clearInterval(dependencies), 5000);
|
|
|
|
function initialization() {
|
|
if (typeof core.session === "undefined") {
|
|
// Not initialized
|
|
|
|
// Write to the core
|
|
core.session = class session {
|
|
/**
|
|
* Current position in hierarchy of the categories
|
|
*/
|
|
static categories = [];
|
|
|
|
/**
|
|
* @return {void}
|
|
*/
|
|
static connect() {
|
|
core.request(
|
|
"/session/connect/telegram",
|
|
window.Telegram.WebApp.initData,
|
|
);
|
|
}
|
|
};
|
|
}
|
|
}
|
|
})
|
|
);
|