Skip to content

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

fix: filter out non-platform announcement buttons

thecodrrc9ce24873acc
diff --git a/apps/web/src/components/announcements/index.js b/apps/web/src/components/announcements/index.js
index 4a6e34cc4..7e3642ce3 100644
--- a/apps/web/src/components/announcements/index.js
+++ b/apps/web/src/components/announcements/index.js
@@ -53,10 +53,9 @@ function Announcements({ announcements, removeAnnouncement }) {
</Text>
)}
<Flex justifyContent="space-evenly" mt={1}>
- {announcement.callToActions?.map((action, index) =>
- action.platforms.some(
- (platform) => allowedPlatforms.indexOf(platform) > -1
- ) ? (
+ {announcement.callToActions
+ ?.filter((platform) => allowedPlatforms.indexOf(platform) > -1)
+ .map((action, index) => (
<Button
flex={1}
m={0}
@@ -98,8 +97,7 @@ function Announcements({ announcements, removeAnnouncement }) {
>
{action.title}
</Button>
- ) : null
- )}
+ ))}
</Flex>
</Flex>
);