mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
[Glitch] Profile redesign: Switch to server flag
Port f7bf804a3f to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { isClientFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
import { isServerFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
|
||||
export function isRedesignEnabled() {
|
||||
return isClientFeatureEnabled('profile_redesign');
|
||||
return isServerFeatureEnabled('profile_redesign');
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import { layoutFromWindow } from 'flavours/glitch/is_mobile';
|
||||
import { selectUnreadNotificationGroupsCount } from 'flavours/glitch/selectors/notifications';
|
||||
import { WithRouterPropTypes } from 'flavours/glitch/utils/react_router';
|
||||
import { checkAnnualReport } from '@/flavours/glitch/reducers/slices/annual_report';
|
||||
import { isServerFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
|
||||
import { uploadCompose, resetCompose, changeComposeSpoilerness } from '../../actions/compose';
|
||||
import { clearHeight } from '../../actions/height_cache';
|
||||
@@ -92,7 +93,6 @@ import { WrappedSwitch, WrappedRoute } from './util/react_router_helpers';
|
||||
// Without this it ends up in ~8 very commonly used bundles.
|
||||
import '../../components/status';
|
||||
import { areCollectionsEnabled } from '../collections/utils';
|
||||
import { isClientFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
|
||||
const messages = defineMessages({
|
||||
beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave Mastodon.' },
|
||||
@@ -170,7 +170,7 @@ class SwitchingColumnsArea extends PureComponent {
|
||||
redirect = <Redirect from='/' to='/about' exact />;
|
||||
}
|
||||
|
||||
const profileRedesignEnabled = isClientFeatureEnabled('profile_redesign');
|
||||
const profileRedesignEnabled = isServerFeatureEnabled('profile_redesign');
|
||||
const profileRedesignRoutes = [];
|
||||
if (profileRedesignEnabled) {
|
||||
profileRedesignRoutes.push(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isClientFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
import { isServerFeatureEnabled } from '@/flavours/glitch/utils/environment';
|
||||
|
||||
export function EmojiPicker () {
|
||||
return import('../../emoji/emoji_picker');
|
||||
@@ -73,7 +73,7 @@ export function PinnedStatuses () {
|
||||
}
|
||||
|
||||
export function AccountTimeline () {
|
||||
if (isClientFeatureEnabled('profile_redesign')) {
|
||||
if (isServerFeatureEnabled('profile_redesign')) {
|
||||
return import('../../account_timeline/v2');
|
||||
}
|
||||
return import('../../account_timeline');
|
||||
|
||||
@@ -12,13 +12,13 @@ export function isProduction() {
|
||||
else return import.meta.env.PROD;
|
||||
}
|
||||
|
||||
export type ServerFeatures = 'fasp' | 'collections';
|
||||
export type ServerFeatures = 'fasp' | 'collections' | 'profile_redesign';
|
||||
|
||||
export function isServerFeatureEnabled(feature: ServerFeatures) {
|
||||
return initialState?.features.includes(feature) ?? false;
|
||||
}
|
||||
|
||||
type ClientFeatures = 'profile_redesign' | 'collections';
|
||||
type ClientFeatures = 'collections';
|
||||
|
||||
export function isClientFeatureEnabled(feature: ClientFeatures) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user