mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 16:23:28 +01:00
Check if window is defined. Not all JS execution environments have it.
This commit is contained in:
parent
e3184622e8
commit
7b2be12587
@ -1081,7 +1081,7 @@
|
||||
|
||||
function getServerCapacity() {
|
||||
let activeDevicesCount = Object.keys(serverState?.devices?.active || {}).length
|
||||
if (window.document.visibilityState === 'hidden') {
|
||||
if (typeof window === "object" && window.document.visibilityState === 'hidden') {
|
||||
activeDevicesCount = 1 + activeDevicesCount
|
||||
}
|
||||
return activeDevicesCount
|
||||
|
Loading…
Reference in New Issue
Block a user