diff --git a/src/components/DropdownButton/DropdownButton.js b/src/components/DropdownButton/DropdownButton.js index 7cb4304db..e7847a4ae 100644 --- a/src/components/DropdownButton/DropdownButton.js +++ b/src/components/DropdownButton/DropdownButton.js @@ -19,7 +19,7 @@ const DropdownButton = ({ return (
- diff --git a/src/pages/view/TitleBar/ActionsBar.js b/src/pages/view/TitleBar/ActionsBar.js index bb2bf0db1..0fdb3c129 100644 --- a/src/pages/view/TitleBar/ActionsBar.js +++ b/src/pages/view/TitleBar/ActionsBar.js @@ -64,6 +64,11 @@ const ViewActions = ({ ? setMoreOptionsSmallIsOpen(!moreOptionsSmallIsOpen) : setMoreOptionsIsOpen(!moreOptionsIsOpen) + const closeMoreOptions = () => { + setMoreOptionsSmallIsOpen(false) + setMoreOptionsIsOpen(false) + } + if (redirectUrl) { return } @@ -86,12 +91,12 @@ const ViewActions = ({ } const onRemoveFromOffline = () => { - toggleMoreOptions() + closeMoreOptions() lastUpdated && remove() } const onAddToOffline = () => { - toggleMoreOptions() + closeMoreOptions() return filtersLength ? setConfirmCacheDialogIsOpen(true) : startRecording({ @@ -101,7 +106,7 @@ const ViewActions = ({ const onToggleShowDescription = () => { updateShowDescription(!showDescription) - toggleMoreOptions() + closeMoreOptions() !offline && apiPostShowDescription(!showDescription) } @@ -109,9 +114,7 @@ const ViewActions = ({ apiStarDashboard(dataEngine, id, !starred) .then(() => { setDashboardStarred(id, !starred) - if (moreOptionsIsOpen) { - toggleMoreOptions() - } + closeMoreOptions() }) .catch(() => { const msg = starred