Skip to content

Commit

Permalink
fix(dashboard): don't show report modal for anonymous user (#17106)
Browse files Browse the repository at this point in the history
* Added sunburst echart

* fix(dashboard):Hide reports modal for anonymous users

* Address comments

* Make prettier happy

Co-authored-by: Mayur <[email protected]>
  • Loading branch information
2 people authored and AAfghahi committed Feb 9, 2022
1 parent a17d5ca commit 98bb7f9
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,8 @@ export default function HeaderReportActionsDropDown({
any,
UserWithPermissionsAndRoles
>(state => state.user || state.explore?.user);
const [
currentReportDeleting,
setCurrentReportDeleting,
] = useState<AlertObject | null>(null);
const [currentReportDeleting, setCurrentReportDeleting] =
useState<AlertObject | null>(null);
const theme = useTheme();
const [showModal, setShowModal] = useState<boolean>(false);
const toggleActiveKey = async (data: AlertObject, checked: boolean) => {
Expand All @@ -81,7 +79,7 @@ export default function HeaderReportActionsDropDown({
if (!isFeatureEnabled(FeatureFlag.ALERT_REPORTS)) {
return false;
}
if (!user) {
if (!user?.userId) {
// this is in the case that there is an anonymous user.
return false;
}
Expand Down

0 comments on commit 98bb7f9

Please sign in to comment.