From 5477e8ae6ebc46709e6278d69b4762e627d7b8cf Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Sun, 5 Feb 2017 23:53:20 +0800 Subject: [PATCH] Strengthen the download toolbar visible condition just like main.js fix #3758 fix #7033 Auditors: @bbondy Test Plan: 1. Toggle clear download history when close Brave 2. Download something to make download tool bar shows 3. Quit Brave when downloading 4. After relaunch brave go to https://github.com/brave/browser-laptop/issues 5. Search something on filter to make autofill popup 6. The popup shouldn't be shifted --- js/contextMenus.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/contextMenus.js b/js/contextMenus.js index 0a0816e3b26..283f6683184 100644 --- a/js/contextMenus.js +++ b/js/contextMenus.js @@ -1404,7 +1404,8 @@ function onShowUsernameMenu (usernames, origin, action, boundingRect, function onShowAutofillMenu (suggestions, boundingRect, frame) { const menuTemplate = autofillTemplateInit(suggestions, frame) - const downloadsBarOffset = windowStore.getState().getIn(['ui', 'downloadsToolbar', 'isVisible']) ? getDownloadsBarHeight() : 0 + const downloadsBarOffset = windowStore.getState().getIn(['ui', 'downloadsToolbar', 'isVisible']) && + appStore.state.get('downloads') && appStore.state.get('downloads').size ? getDownloadsBarHeight() : 0 const offset = { x: (window.innerWidth - boundingRect.clientWidth), y: (window.innerHeight - boundingRect.clientHeight)