Skip to content

Commit e9ba2cc

Browse files
committed
feat: remove ADV-related analytics and user preferences for cleaner code
1 parent d48e730 commit e9ba2cc

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

src/App.tsx

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import clsx from 'clsx'
22
import { useEffect, useLayoutEffect } from 'react'
33
import { DNDLayout } from 'src/components/Layout'
4-
import {
5-
identifyAdvBlocked,
6-
setupAnalytics,
7-
setupIdentification,
8-
trackPageView,
9-
} from 'src/lib/analytics'
4+
import { setupAnalytics, setupIdentification, trackPageView } from 'src/lib/analytics'
105
import { useUserPreferences } from 'src/stores/preferences'
116
import { AppContentLayout } from './components/Layout'
12-
import { verifyAdvStatus } from './features/adv/utils/status'
137
import { lazyImport } from './utils/lazyImport'
148
const { OnboardingModal } = lazyImport(() => import('src/features/onboarding'), 'OnboardingModal')
159

@@ -27,7 +21,6 @@ export const App = () => {
2721
const {
2822
maxVisibleCards,
2923
onboardingCompleted,
30-
setAdvStatus,
3124
isDNDModeActive,
3225
layout,
3326
DNDDuration,
@@ -42,12 +35,6 @@ export const App = () => {
4235
document.body.classList.remove('preload')
4336
setupAnalytics()
4437
setupIdentification()
45-
const adVerifier = async () => {
46-
const status = await verifyAdvStatus()
47-
setAdvStatus(status)
48-
identifyAdvBlocked(status)
49-
}
50-
adVerifier()
5138
}, [])
5239

5340
useEffect(() => {

src/lib/analytics.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export enum Attributes {
7676
MAX_VISIBLE_CARDS = 'Max Visible Cards',
7777
DURATION = 'Duration',
7878
PROVIDER = 'Provider',
79-
ADV = 'ADV',
8079
STREAK = 'Streak',
8180
DISPLAY_LAYOUT = 'Display Layout',
8281
}
@@ -467,9 +466,6 @@ export const identifyUserOccupation = (occupation: string) => {
467466
export const identifyUserMaxVisibleCards = (maxVisibleCards: number) => {
468467
identifyUserProperty(Attributes.MAX_VISIBLE_CARDS, maxVisibleCards)
469468
}
470-
export const identifyAdvBlocked = (blocked: boolean) => {
471-
identifyUserProperty(Attributes.ADV, blocked)
472-
}
473469
export const identifyUserStreak = (value: number) => {
474470
identifyUserProperty(Attributes.STREAK, value)
475471
}

src/stores/preferences.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export type UserPreferencesState = {
3434
cardsSettings: Record<string, CardSettingsType>
3535
firstSeenDate: number
3636
userCustomCards: SupportedCardType[]
37-
advStatus: boolean
3837
DNDDuration: DNDDuration
3938
showReadPosts: boolean
4039
}
@@ -61,7 +60,6 @@ type UserPreferencesStoreActions = {
6160
isDNDModeActive: () => boolean
6261
addSearchEngine: (searchEngine: SearchEngineType) => void
6362
removeSearchEngine: (searchEngineUrl: string) => void
64-
setAdvStatus: (status: boolean) => void
6563
setShowReadPosts: (value: boolean) => void
6664
}
6765

@@ -93,7 +91,6 @@ export const useUserPreferences = create(
9391
],
9492
userCustomCards: [],
9593
DNDDuration: 'never',
96-
advStatus: false,
9794
showReadPosts: true,
9895
setLayout: (layout) => set({ layout }),
9996
setPromptEngine: (promptEngine: string) => set({ promptEngine }),
@@ -168,7 +165,6 @@ export const useUserPreferences = create(
168165
promptEngines: state.promptEngines.filter((se) => se.url !== engine),
169166
}
170167
}),
171-
setAdvStatus: (status) => set({ advStatus: status }),
172168
setShowReadPosts: (value) => set({ showReadPosts: value }),
173169
removeCard: (cardName: string) =>
174170
set((state) => {

0 commit comments

Comments
 (0)