Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove test gates (#7477)

authored by

dan and committed by
GitHub
c84158fa f5d28de7

+1 -77
+1 -77
src/view/screens/Profile.tsx
··· 1 - import React, {useCallback, useEffect, useMemo} from 'react' 1 + import React, {useCallback, useMemo} from 'react' 2 2 import {StyleSheet} from 'react-native' 3 3 import {SafeAreaView} from 'react-native-safe-area-context' 4 4 import { ··· 20 20 import {useSetTitle} from '#/lib/hooks/useSetTitle' 21 21 import {ComposeIcon2} from '#/lib/icons' 22 22 import {CommonNavigatorParams, NativeStackScreenProps} from '#/lib/routes/types' 23 - import {logEvent, useGate} from '#/lib/statsig/statsig' 24 23 import {combinedDisplayName} from '#/lib/strings/display-names' 25 24 import {cleanError} from '#/lib/strings/errors' 26 25 import {isInvalidHandle} from '#/lib/strings/handles' ··· 497 496 accessibilityHint="" 498 497 /> 499 498 )} 500 - <TestGates /> 501 499 </ScreenHider> 502 500 ) 503 501 } ··· 556 554 textAlign: 'center', 557 555 }, 558 556 }) 559 - 560 - const shouldExposeToGate2 = Math.random() < 0.2 561 - 562 - // --- Temporary: we're testing our Statsig setup --- 563 - let TestGates = React.memo(function TestGates() { 564 - const gate = useGate() 565 - 566 - useEffect(() => { 567 - logEvent('test:all:always', {}) 568 - if (Math.random() < 0.2) { 569 - logEvent('test:all:sometimes', {}) 570 - } 571 - if (Math.random() < 0.1) { 572 - logEvent('test:all:boosted_by_gate1', { 573 - reason: 'base', 574 - }) 575 - } 576 - if (Math.random() < 0.1) { 577 - logEvent('test:all:boosted_by_gate2', { 578 - reason: 'base', 579 - }) 580 - } 581 - if (Math.random() < 0.1) { 582 - logEvent('test:all:boosted_by_both', { 583 - reason: 'base', 584 - }) 585 - } 586 - }, []) 587 - 588 - return [ 589 - gate('test_gate_1') ? <TestGate1 /> : null, 590 - shouldExposeToGate2 && gate('test_gate_2') ? <TestGate2 /> : null, 591 - ] 592 - }) 593 - 594 - function TestGate1() { 595 - useEffect(() => { 596 - logEvent('test:gate1:always', {}) 597 - if (Math.random() < 0.2) { 598 - logEvent('test:gate1:sometimes', {}) 599 - } 600 - if (Math.random() < 0.5) { 601 - logEvent('test:all:boosted_by_gate1', { 602 - reason: 'gate1', 603 - }) 604 - } 605 - if (Math.random() < 0.5) { 606 - logEvent('test:all:boosted_by_both', { 607 - reason: 'gate1', 608 - }) 609 - } 610 - }, []) 611 - return null 612 - } 613 - 614 - function TestGate2() { 615 - useEffect(() => { 616 - logEvent('test:gate2:always', {}) 617 - if (Math.random() < 0.2) { 618 - logEvent('test:gate2:sometimes', {}) 619 - } 620 - if (Math.random() < 0.5) { 621 - logEvent('test:all:boosted_by_gate2', { 622 - reason: 'gate2', 623 - }) 624 - } 625 - if (Math.random() < 0.5) { 626 - logEvent('test:all:boosted_by_both', { 627 - reason: 'gate2', 628 - }) 629 - } 630 - }, []) 631 - return null 632 - }