From 79378c536ee92fbaf384c2434830fc56020d61ea Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 19 Oct 2020 14:17:53 +0200 Subject: [PATCH] Fix duplicate team script to support owners --- www/common/outer/team.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/common/outer/team.js b/www/common/outer/team.js index 4ecfc09b6..f340c156e 100644 --- a/www/common/outer/team.js +++ b/www/common/outer/team.js @@ -1676,22 +1676,22 @@ define([ // Not found yet? add to the list if (!_t) { - _teams[t.channel] = { edit: Boolean(t.hash), id:id }; + _teams[t.channel] = { edit: Boolean(t.hash), owner: t.owner, id:id }; return; } // Team already found. If this one has better access rights, keep it. // Otherwise, delete it - // No edit right or we already have edit rights? delete - if (!t.hash || _t.edit) { + // No edit right or we already had edit rights? delete + if (!t.hash || (!t.owner && _t.edit) || _t.owner) { delete teams[id]; return; } // We didn't have edit rights and now we have them: replace delete teams[_t.id]; - _teams[t.channel] = { edit: Boolean(t.hash), id:id }; + _teams[t.channel] = { edit: Boolean(t.hash), owner: t.owner, id:id }; }); // Load teams