From a3721ce52792d33c756880f89afbf43f5bada3db Mon Sep 17 00:00:00 2001 From: Tangled Date: Wed, 3 Dec 2025 04:06:58 +0000 Subject: [PATCH] tweak to disable email verification reminder popup this also changes the popup a bit for more of a witchsky style, please read the code comments i left in src/alf/tokens.ts and src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx this does not bypass any feature on bluesky that is locked behind a email verification if the pds is setup that way, this only gets rid of the reminder so if ur using a bluesky pds that doesnt have email verification but fully functions without a verified email, u dont need to get a pointless reminder every day praying nothing goes wrong, still cant fork the repo --- src/Navigation.tsx | 5 +- src/alf/tokens.ts | 2 + .../screens/VerificationReminder.tsx | 9 +++- src/screens/Settings/DeerSettings.tsx | 42 ++++++++++++--- src/state/persisted/schema.ts | 2 + .../disable-verify-email-reminder.tsx | 52 +++++++++++++++++++ src/state/preferences/index.tsx | 5 +- 7 files changed, 105 insertions(+), 12 deletions(-) create mode 100644 src/state/preferences/disable-verify-email-reminder.tsx diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 7ce11faa6..870f8a3b7 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -43,6 +43,7 @@ import {attachRouteToLogEvents, logEvent} from '#/lib/statsig/statsig' import {bskyTitle} from '#/lib/strings/headings' import {logger} from '#/logger' import {isNative, isWeb} from '#/platform/detection' +import {useDisableVerifyEmailReminder} from '#/state/preferences/disable-verify-email-reminder' import {useUnreadNotifications} from '#/state/queries/notifications/unread' import {useSession} from '#/state/session' import { @@ -867,6 +868,8 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { const emailDialogControl = useEmailDialogControl() const closeAllActiveElements = useCloseAllActiveElements() + const disableVerifyEmailReminder = useDisableVerifyEmailReminder() + /** * Handle navigation to a conversation, or prepares for account switch. * @@ -955,7 +958,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { function onReady() { prevLoggedRouteName.current = getCurrentRouteName() - if (currentAccount && shouldRequestEmailConfirmation(currentAccount)) { + if (currentAccount && shouldRequestEmailConfirmation(currentAccount) && !disableVerifyEmailReminder) { emailDialogControl.open({ id: EmailDialogScreenID.VerificationReminder, }) diff --git a/src/alf/tokens.ts b/src/alf/tokens.ts index 633ea7af5..3323e6226 100644 --- a/src/alf/tokens.ts +++ b/src/alf/tokens.ts @@ -7,6 +7,8 @@ export const color = { temp_purple_dark: tokens.labelerColor.purple_dark, } as const +// FIXME: some of these should probs be changed up for witchsky branding reasons, they should also work with all the other themes + export const gradients = { primary: { values: [ diff --git a/src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx b/src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx index 77ee6ae09..1a03c8133 100644 --- a/src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx +++ b/src/components/dialogs/EmailDialog/screens/VerificationReminder.tsx @@ -24,6 +24,11 @@ export function VerificationReminder({ const dialogPadding = gtMobile ? a.p_2xl.padding : a.p_xl.padding + // FIXME: the usage of "tokens.gradients.summer" here is temporary, + // its the closest thats built into bluesky that matches witchskys color scheme + // someone, preferbly xan, should edit src/alf/tokens.ts to have proper witchsky colors + // maybe even support all the other themes too? + return ( - + @@ -64,7 +69,7 @@ export function VerificationReminder({ Your email has not yet been verified. Please verify your email in - order to enjoy all the features of Bluesky. + order to enjoy all the features of Witchsky. diff --git a/src/screens/Settings/DeerSettings.tsx b/src/screens/Settings/DeerSettings.tsx index 2a82c6466..c0060c7ae 100644 --- a/src/screens/Settings/DeerSettings.tsx +++ b/src/screens/Settings/DeerSettings.tsx @@ -29,6 +29,10 @@ import { useDirectFetchRecords, useSetDirectFetchRecords, } from '#/state/preferences/direct-fetch-records' +import { + useDisableFollowedByMetrics, + useSetDisableFollowedByMetrics +} from '#/state/preferences/disable-followed-by-metrics' import { useDisableFollowersMetrics, useSetDisableFollowersMetrics @@ -37,14 +41,14 @@ import { useDisableFollowingMetrics, useSetDisableFollowingMetrics } from '#/state/preferences/disable-following-metrics' -import { - useDisableFollowedByMetrics, - useSetDisableFollowedByMetrics -} from '#/state/preferences/disable-followed-by-metrics' import { useDisableLikesMetrics, useSetDisableLikesMetrics, } from '#/state/preferences/disable-likes-metrics' +import { + useDisablePostsMetrics, + useSetDisablePostsMetrics, +} from '#/state/preferences/disable-posts-metrics' import { useDisableQuotesMetrics, useSetDisableQuotesMetrics, @@ -53,10 +57,6 @@ import { useDisableReplyMetrics, useSetDisableReplyMetrics, } from '#/state/preferences/disable-reply-metrics' -import { - useDisablePostsMetrics, - useSetDisablePostsMetrics, -} from '#/state/preferences/disable-posts-metrics' import { useDisableRepostsMetrics, useSetDisableRepostsMetrics, @@ -65,6 +65,10 @@ import { useDisableSavesMetrics, useSetDisableSavesMetrics, } from '#/state/preferences/disable-saves-metrics' +import { + useDisableVerifyEmailReminder, + useSetDisableVerifyEmailReminder, +} from '#/state/preferences/disable-verify-email-reminder' import { useDisableViaRepostNotification, useSetDisableViaRepostNotification, @@ -319,6 +323,9 @@ export function DeerSettingsScreen({}: Props) { const enableSquareButtons = useEnableSquareButtons() const setEnableSquareButtons = useSetEnableSquareButtons() + const disableVerifyEmailReminder = useDisableVerifyEmailReminder() + const setDisableVerifyEmailReminder = useSetDisableVerifyEmailReminder() + const constellationInstance = useConstellationInstance() const setConstellationInstanceControl = Dialog.useDialogControl() @@ -617,6 +624,25 @@ export function DeerSettingsScreen({}: Props) { + + setDisableVerifyEmailReminder(value)} + style={[a.w_full]}> + + Disable verify email reminder + + + + + + This only gets rid of the reminder on app launch, + useful if your PDS does not have email verification setup.\nThis + does NOT give access to features locked behind email verification. + + diff --git a/src/state/persisted/schema.ts b/src/state/persisted/schema.ts index 29618c1d4..d64f0d3ea 100644 --- a/src/state/persisted/schema.ts +++ b/src/state/persisted/schema.ts @@ -158,6 +158,7 @@ const schema = z.object({ hideSimilarAccountsRecomm: z.boolean().optional(), enableSquareAvatars: z.boolean().optional(), enableSquareButtons: z.boolean().optional(), + disableVerifyEmailReminder: z.boolean().optional(), deerVerification: z .object({ enabled: z.boolean(), @@ -245,6 +246,7 @@ export const defaults: Schema = { hideSimilarAccountsRecomm: true, enableSquareAvatars: false, enableSquareButtons: false, + disableVerifyEmailReminder: false, deerVerification: { enabled: false, // https://witchsky.app/profile/did:plc:p2cp5gopk7mgjegy6wadk3ep/post/3lndyqyyr4k2k diff --git a/src/state/preferences/disable-verify-email-reminder.tsx b/src/state/preferences/disable-verify-email-reminder.tsx new file mode 100644 index 000000000..25324f29d --- /dev/null +++ b/src/state/preferences/disable-verify-email-reminder.tsx @@ -0,0 +1,52 @@ +import React from 'react' + +import * as persisted from '#/state/persisted' + +// Preference: disableVerifyEmailReminder – when true, disables the "verify email" reminder that you get on boot on mobile, useful if you are on a PDS without any email verification setup + +type StateContext = persisted.Schema['disableVerifyEmailReminder'] +// Same setter signature used across other preference modules +type SetContext = (v: persisted.Schema['disableVerifyEmailReminder']) => void + +const stateContext = React.createContext( + persisted.defaults.disableVerifyEmailReminder, +) +const setContext = React.createContext( + (_: persisted.Schema['disableVerifyEmailReminder']) => {}, +) + +export function Provider({children}: React.PropsWithChildren<{}>) { + const [state, setState] = React.useState( + persisted.get('disableVerifyEmailReminder'), + ) + + const setStateWrapped = React.useCallback( + (value: persisted.Schema['disableVerifyEmailReminder']) => { + setState(value) + persisted.write('disableVerifyEmailReminder', value) + }, + [setState], + ) + + React.useEffect(() => { + return persisted.onUpdate('disableVerifyEmailReminder', next => { + setState(next) + }) + }, [setStateWrapped]) + + return ( + + + {children} + + + ) +} + +export function useDisableVerifyEmailReminder() { + return React.useContext(stateContext) +} + +export function useSetDisableVerifyEmailReminder() { + return React.useContext(setContext) +} diff --git a/src/state/preferences/index.tsx b/src/state/preferences/index.tsx index 719e891ee..e7a852ede 100644 --- a/src/state/preferences/index.tsx +++ b/src/state/preferences/index.tsx @@ -16,6 +16,7 @@ import {Provider as DisableQuotesMetricsProvider} from './disable-quotes-metrics import {Provider as DisableReplyMetricsProvider} from './disable-reply-metrics' import {Provider as DisableRepostsMetricsProvider} from './disable-reposts-metrics' import {Provider as DisableSavesMetricsProvider} from './disable-saves-metrics' +import {Provider as DisableVerifyEmailReminderProvider} from './disable-verify-email-reminder' import {Provider as DisableViaRepostNotificationProvider} from './disable-via-repost-notification' import {Provider as EnableSquareAvatarsProvider} from './enable-square-avatars' import {Provider as EnableSquareButtonsProvider} from './enable-square-buttons' @@ -97,7 +98,9 @@ export function Provider({children}: React.PropsWithChildren<{}>) { - {children} + + {children} + -- 2.51.2