From bfd46fb570170c5ab43aaf2f8ad3659728d58ae5 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 Nov 2019 16:45:06 +0100 Subject: [PATCH] Destroy team rpc when demoted to viewer --- www/common/outer/team.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 151dff6c9..b1be2baea 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1035,6 +1035,10 @@ define([ team.userObject.setReadOnly(!secret.keys.secondaryKey, secret.keys.secondaryKey); } + if (!secret.keys.secondaryKey && team.rpc) { + team.rpc.destroy(); + } + // Upgrade the shared folders var folders = Util.find(team, ['proxy', 'drive', 'sharedFolders']); Object.keys(folders || {}).forEach(function (sfId) {