forked from extern/easydiffusion
Merge pull request #639 from madrang/newEngine
Check if window is defined. Not all JS execution environments have it.
This commit is contained in:
commit
d3c3496e55
@ -1081,7 +1081,7 @@
|
|||||||
|
|
||||||
function getServerCapacity() {
|
function getServerCapacity() {
|
||||||
let activeDevicesCount = Object.keys(serverState?.devices?.active || {}).length
|
let activeDevicesCount = Object.keys(serverState?.devices?.active || {}).length
|
||||||
if (window.document.visibilityState === 'hidden') {
|
if (typeof window === "object" && window.document.visibilityState === 'hidden') {
|
||||||
activeDevicesCount = 1 + activeDevicesCount
|
activeDevicesCount = 1 + activeDevicesCount
|
||||||
}
|
}
|
||||||
return activeDevicesCount
|
return activeDevicesCount
|
||||||
|
Loading…
Reference in New Issue
Block a user