mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-28 17:22:15 +08:00
fix: replace toSorted with slice().sort() for macOS 12 compatibility (#7247)
* fix: replace toSorted with slice().sort() for macOS 12 compatibility Array.prototype.toSorted() is ES2023 and not supported in WebKit < 16 (bundled with macOS 12 Monterey). Using slice().sort() is functionally identical and works on all platforms. Fixes #7216 * chore: update Changelog --------- Co-authored-by: Tunglies <77394545+Tunglies@users.noreply.github.com>
This commit is contained in:
+1
-1
@@ -145,7 +145,7 @@ export const getIpInfo = async (): Promise<
|
||||
const maxRetries = 2
|
||||
const serviceTimeout = 5000
|
||||
|
||||
const shuffledServices = IP_CHECK_SERVICES.toSorted(() => Math.random() - 0.5)
|
||||
const shuffledServices = IP_CHECK_SERVICES.slice().sort(() => Math.random() - 0.5)
|
||||
let lastError: unknown | null = null
|
||||
const userAgent = await getUserAgentPromise()
|
||||
console.debug('User-Agent for IP detection:', userAgent)
|
||||
|
||||
Reference in New Issue
Block a user