feat: telegram use the random domain when not set (#704)

This commit is contained in:
Dream Hunter
2025-08-08 13:07:00 +08:00
committed by GitHub
parent bfd66f5019
commit 9843b35f54
10 changed files with 1265 additions and 1276 deletions

View File

@@ -108,9 +108,9 @@ export const newAddress = async (
}
// check domain
const allowDomains = checkAllowDomains ? await getAllowDomains(c) : getDomains(c);
// if domain is not set, use the first domain
// if domain is not set, use the random domain
if (!domain && allowDomains.length > 0) {
domain = allowDomains[0];
domain = allowDomains[Math.floor(Math.random() * allowDomains.length)];
}
// check domain is valid
if (!domain || !allowDomains.includes(domain)) {

View File

@@ -1,5 +1,5 @@
export const CONSTANTS = {
VERSION: 'v' + '1.0.2',
VERSION: 'v' + '1.0.3',
// DB Version
DB_VERSION_KEY: 'db_version',