mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 桌面端系统休眠唤醒后判断网络连通性后再执行数据同步 Fix https://github.com/siyuan-note/siyuan/issues/6687
This commit is contained in:
parent
2217f92df5
commit
e7d1312914
1 changed files with 6 additions and 1 deletions
|
|
@ -835,6 +835,11 @@ const isOnline = async () => {
|
||||||
const result = await fetch("https://icanhazip.com", {timeout: 1000})
|
const result = await fetch("https://icanhazip.com", {timeout: 1000})
|
||||||
return 200 === result.status
|
return 200 === result.status
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return false;
|
try {
|
||||||
|
const result = await fetch("https://www.baidu.com", {timeout: 1000})
|
||||||
|
return 200 === result.status
|
||||||
|
} catch (e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue