|
|
@@ -22,11 +22,11 @@ function rpcCleanUp(kind, target) { |
|
|
|
for([uid, info] of Object.entries(allRPCs)) { |
|
|
|
const sameKind = info.kind === kind |
|
|
|
const sameTarget = info.target === target |
|
|
|
|
|
|
|
let shouldClose = false |
|
|
|
shouldClose ||= !State.online.includes(info.target) |
|
|
|
shouldClose ||= (sameKind && kind === 'screen') |
|
|
|
shouldClose ||= (sameKind && kind === 'video' && sameTarget) |
|
|
|
const shouldClose = (false |
|
|
|
|| !State.online.includes(info.target) |
|
|
|
|| (sameKind && kind === 'screen') |
|
|
|
|| (sameKind && kind === 'video' && sameTarget) |
|
|
|
) |
|
|
|
|
|
|
|
if(shouldClose) { |
|
|
|
info.rpc.close() |