From 80bc0f1febbe561284fe33cc41a0bf32465af444 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 10 Nov 2024 15:40:20 -0600 Subject: [PATCH] Remove becoming a developer through the JS console --- src/globals.ts | 23 ----------------------- src/init/soapbox.tsx | 4 ---- 2 files changed, 27 deletions(-) delete mode 100644 src/globals.ts diff --git a/src/globals.ts b/src/globals.ts deleted file mode 100644 index e67c5742b..000000000 --- a/src/globals.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * globals: do things through the console. - * This feature is for developers. - */ -import { changeSettingImmediate } from 'soapbox/actions/settings.ts'; - -import type { Store } from 'soapbox/store.ts'; - -/** Add Soapbox globals to the window. */ -export const createGlobals = (store: Store) => { - const Soapbox = { - /** Become a developer with `Soapbox.isDeveloper()` */ - isDeveloper: (bool = true): boolean => { - if (![true, false].includes(bool)) { - throw `Invalid option ${bool}. Must be true or false.`; - } - store.dispatch(changeSettingImmediate(['isDeveloper'], bool) as any); - return bool; - }, - }; - - (window as any).Soapbox = Soapbox; -}; diff --git a/src/init/soapbox.tsx b/src/init/soapbox.tsx index cbddedf53..be0caa3a7 100644 --- a/src/init/soapbox.tsx +++ b/src/init/soapbox.tsx @@ -3,7 +3,6 @@ import { Provider } from 'react-redux'; import { NostrProvider } from 'soapbox/contexts/nostr-context.tsx'; import { StatProvider } from 'soapbox/contexts/stat-context.tsx'; -import { createGlobals } from 'soapbox/globals.ts'; import { queryClient } from 'soapbox/queries/client.ts'; import { checkOnboardingStatus } from '../actions/onboarding.ts'; @@ -14,9 +13,6 @@ import SoapboxHead from './soapbox-head.tsx'; import SoapboxLoad from './soapbox-load.tsx'; import SoapboxMount from './soapbox-mount.tsx'; -// Configure global functions for developers -createGlobals(store); - // Preload happens synchronously store.dispatch(preload() as any);