From 8eed376274aac7a388755e1f30d125a6f652908e Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 18 Dec 2019 12:42:24 +0100 Subject: [PATCH] Fix default category after joining a team --- www/common/common-ui-elements.js | 2 +- www/teams/inner.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index f61c0a641..c1c8bf2b1 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -1701,7 +1701,7 @@ define([ var $nav = $linkContent.closest('.alertify').find('nav'); $(linkError).text('').hide(); var name = $(linkName).val(); - var pw = $(linkPassword).val(); + var pw = $(linkPassword).find('input').val(); var msg = $(linkMessage).val(); var hash = Hash.createRandomHash('invite', pw); var hashData = Hash.parseTypeHash('invite', hash); diff --git a/www/teams/inner.js b/www/teams/inner.js index 040d7ffeb..a00c035b7 100644 --- a/www/teams/inner.js +++ b/www/teams/inner.js @@ -184,7 +184,7 @@ define([ var $categories = $('
', {'class': 'cp-sidebarlayout-categories'}) .appendTo(APP.$leftside); - var hash = common.getMetadataMgr().getPrivateData().teamInviteHash; + var hash = common.getMetadataMgr().getPrivateData().teamInviteHash && mainCategories.link; var categories = team ? teamCategories : mainCategories; var active = team ? 'drive' : (hash ? 'link' : 'list'); @@ -1051,6 +1051,7 @@ define([ }; refreshLink = function (common, cb) { + if (!mainCategories.link) { return; } var privateData = common.getMetadataMgr().getPrivateData(); var hash = privateData.teamInviteHash; var hashData = Hash.parseTypeHash('invite', hash); @@ -1133,6 +1134,7 @@ define([ if ($divLink.length) { $divLink.remove(); $('div.cp-team-cat-link').remove(); + delete mainCategories.link; } }); var $divCreate = $('div.cp-team-create');