Skip to content

Commit

Permalink
Merge pull request #2013 from akto-api-security/feature/subscribe_to_…
Browse files Browse the repository at this point in the history
…updates

Added checkbox
notshivansh authored Jan 23, 2025
2 parents ea1c842 + fc5143c commit e9874d2
Showing 1 changed file with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, ButtonGroup, Divider, LegacyCard, Text, VerticalStack, HorizontalGrid, HorizontalStack, Scrollable, TextField, Tag, Form, Tooltip } from '@shopify/polaris'
import { Box, Button, ButtonGroup, Divider, LegacyCard, Text, VerticalStack, HorizontalGrid, HorizontalStack, Scrollable, TextField, Tag, Form, Tooltip, Checkbox } from '@shopify/polaris'
import React, { useEffect, useState } from 'react'
import settingFunctions from '../module'
import Dropdown from '../../../components/layouts/Dropdown'
@@ -40,6 +40,9 @@ function About() {
const [accountName, setAccountName] = useState('')
const [currentTimeZone, setCurrentTimeZone] = useState('')
const [toggleCaseSensitiveApis, setToggleCaseSensitiveApis] = useState(false)
const [isSubscribed, setIsSubscribed] = useState(() => {
return localStorage.getItem('isSubscribed') === 'true'
})

const initialUrlsList = settingFunctions.getRedundantUrlOptions()
const [selectedUrlList, setSelectedUrlsList] = useState([])
@@ -169,6 +172,28 @@ function About() {
</VerticalStack>
</Box>
))}
<Checkbox
label="Subscribe to updates"
checked={isSubscribed}
onChange={() => {
const userProps = {}
let subsKey = window.DASHBOARD_MODE === 'ON_PREM' ? "mono_subscribed" : "akto_subscribed"
userProps[subsKey] = "yes"
if (window.Intercom) {
window.Intercom("update", userProps)
window.Intercom("trackEvent", subsKey)
}

if (window.mixpanel) {
window.mixpanel.people.set(userProps);
}
setIsSubscribed(!isSubscribed)
localStorage.setItem('isSubscribed', (!isSubscribed).toString())
if (!isSubscribed) {
func.setToast(true, false, "Successfully subscribed to updates")
}
}}
/>
</VerticalStack>
)

0 comments on commit e9874d2

Please sign in to comment.