fix: 修复部分环境无 clearTimeout 的问题

This commit is contained in:
xream 2023-09-18 20:09:03 +08:00
parent 9acc161684
commit 7603fac036
No known key found for this signature in database
GPG Key ID: 1D2C5225471789F9
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.58",
"version": "2.14.59",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {

View File

@ -316,7 +316,9 @@ export function HTTP(defaultOptions = { baseURL: '' }) {
return (
timer
? Promise.race([timer, worker]).then((res) => {
clearTimeout(timeoutid);
if (typeof clearTimeout !== 'undefined') {
clearTimeout(timeoutid);
}
return res;
})
: worker