Remove becoming a developer through the JS console
This commit is contained in:
parent
669c28063d
commit
80bc0f1feb
|
@ -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;
|
|
||||||
};
|
|
|
@ -3,7 +3,6 @@ import { Provider } from 'react-redux';
|
||||||
|
|
||||||
import { NostrProvider } from 'soapbox/contexts/nostr-context.tsx';
|
import { NostrProvider } from 'soapbox/contexts/nostr-context.tsx';
|
||||||
import { StatProvider } from 'soapbox/contexts/stat-context.tsx';
|
import { StatProvider } from 'soapbox/contexts/stat-context.tsx';
|
||||||
import { createGlobals } from 'soapbox/globals.ts';
|
|
||||||
import { queryClient } from 'soapbox/queries/client.ts';
|
import { queryClient } from 'soapbox/queries/client.ts';
|
||||||
|
|
||||||
import { checkOnboardingStatus } from '../actions/onboarding.ts';
|
import { checkOnboardingStatus } from '../actions/onboarding.ts';
|
||||||
|
@ -14,9 +13,6 @@ import SoapboxHead from './soapbox-head.tsx';
|
||||||
import SoapboxLoad from './soapbox-load.tsx';
|
import SoapboxLoad from './soapbox-load.tsx';
|
||||||
import SoapboxMount from './soapbox-mount.tsx';
|
import SoapboxMount from './soapbox-mount.tsx';
|
||||||
|
|
||||||
// Configure global functions for developers
|
|
||||||
createGlobals(store);
|
|
||||||
|
|
||||||
// Preload happens synchronously
|
// Preload happens synchronously
|
||||||
store.dispatch(preload() as any);
|
store.dispatch(preload() as any);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue