Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: fix announcement cta not working

Abdullah Atta8cfb21e77148
diff --git a/apps/web/src/components/announcements/body.js b/apps/web/src/components/announcements/body.js
index a753b9b19..1cff5d731 100644
--- a/apps/web/src/components/announcements/body.js
+++ b/apps/web/src/components/announcements/body.js
@@ -84,7 +84,12 @@ export default function AnnouncementBody({
/>
);
case "callToActions":
- return <InlineCalltoActions item={item} />;
+ return (
+ <InlineCalltoActions
+ item={item}
+ removeAnnouncement={removeAnnouncement}
+ />
+ );
case "text":
return (
<Text
@@ -252,7 +257,7 @@ function CalltoActions({ item, removeAnnouncement }) {
);
}
-function InlineCalltoActions({ item }) {
+function InlineCalltoActions({ item, removeAnnouncement }) {
const { actions, style } = item;
return (
<Flex px={2} sx={mapStyle(style)}>
@@ -278,6 +283,7 @@ function InlineCalltoActions({ item }) {
mr: 1
}
}}
+ removeAnnouncement={removeAnnouncement}
/>
))}
</Flex>
@@ -290,7 +296,7 @@ function CalltoAction({ action, variant, sx, removeAnnouncement }) {
variant={variant}
sx={sx}
onClick={async () => {
- removeAnnouncement();
+ if (removeAnnouncement) removeAnnouncement();
closeOpenedDialog();
trackEvent(ANALYTICS_EVENTS.announcementCta, action.data);
switch (action.type) {