From 67d881b2cfa0efa1b33b7bd8c95736e39a8298f9 Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 8 Feb 2017 16:25:52 +0100 Subject: [PATCH] Remove the drive entry from the user menu if already in drive --- www/common/toolbar.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index b7b0f54ad..97aa7c535 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -415,14 +415,17 @@ define([ content: Messages.user_rename }); } - options.push({ - tag: 'a', - attributes: { - 'target': '_blank', - 'href': '/drive/' - }, - content: Messages.login_accessDrive - }); + var parsed = Cryptpad.parsePadUrl(window.location.href); + if (parsed && parsed.type && parsed.type !== 'drive') { + options.push({ + tag: 'a', + attributes: { + 'target': '_blank', + 'href': '/drive/' + }, + content: Messages.login_accessDrive + }); + } // Add login or logout button depending on the current status if (account) { options.push({