Remove becoming a developer through the JS console

This commit is contained in:
Alex Gleason 2024-11-10 15:40:20 -06:00
parent 669c28063d
commit 80bc0f1feb
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 0 additions and 27 deletions

View File

@ -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;
};

View File

@ -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);