function checkAuth(from_id, first_name) {
return new Promise(function (resolve, reject) => {
conn.query(`SELECT * FROM \`users\` WHERE \`id\` = '${from_id}'`, function (error, results) {
if (error) {
console.error(error);
reject(error);
}
let result = JSON.parse(JSON.stringify(results)); // ???
if (result[0] === undefined) {
conn.query(`INSERT INTO \`users\` (\`id\`, \`name\`, \`balance\`) VALUES ('${from_id}', '${first_name}', '0')`, function (error, results) {
if (error) {
console.error(error);
reject(error);
}
resolve('unf');
});
} else {
resolve(['jopa']);
}
});
});
}
async function some() {
let response = await checkAuth(..., ...);
}
some();
sliderValue.text(Number(slider.value).toLocaleString('ru-RU'));
mix-blend-mode
пробовали убирать? let size = svg.getBoundingClientRect();
...
const debounce = (callback, duration) => {
let timeout = null;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(callback, duration, ...args);
};
};
...
window.addEventListener('resize', debounce(() => {
size = svg.getBoundingClientRect();
}, 100));