Skip to content

Commit

Permalink
remove FF (#2622)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratik21 authored Jan 25, 2025
1 parent ea2b1a4 commit 084c281
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import { Button } from '@zero-tech/zui/components/Button';
import { ConnectButton } from '@rainbow-me/rainbowkit';
import { State } from '../../../../store/account-management';

const featureFlags = { enableAccountAbstraction: false };
jest.mock('../../../../lib/feature-flags', () => ({
featureFlags: featureFlags,
}));

// Mock the ConnectButton from rainbowkit
jest.mock('@rainbow-me/rainbowkit', () => ({
ConnectButton: {
Expand Down Expand Up @@ -302,23 +297,6 @@ describe(AccountManagementPanel, () => {
});

describe('thirdweb wallets section', () => {
beforeEach(() => {
featureFlags.enableAccountAbstraction = true;
});

it('returns null if feature flag is disabled', () => {
featureFlags.enableAccountAbstraction = false;
const wrapper = subject({
currentUser: {
wallets: [{ id: 'wallet-id-1', isThirdWeb: true, publicAddress: '0x123' }],
primaryEmail: '[email protected]',
},
});

const thirdWebWallet = wrapper.find(c('wallets-header')).at(1);
expect(thirdWebWallet.length).toEqual(0);
});

it('does not render thirdweb section when no thirdweb wallets exist', () => {
const wrapper = subject({
currentUser: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ConnectButton } from '@rainbow-me/rainbowkit';
import { Color, Modal, Variant } from '../../../modal';
import { State as AddWalletState } from '../../../../store/account-management';
import { getChain } from '../../../../lib/web3/thirdweb/client';
import { featureFlags } from '../../../../lib/feature-flags';

const cn = bemClassName('account-management-panel');

Expand Down Expand Up @@ -121,10 +120,6 @@ export class AccountManagementPanel extends React.Component<Properties, State> {
};

renderThirdWebWalletsSection = () => {
if (!featureFlags.enableAccountAbstraction) {
return null;
}

const wallets = this.getThirdWebWallets();
if (wallets.length === 0) {
return null;
Expand Down
8 changes: 0 additions & 8 deletions src/lib/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,6 @@ export class FeatureFlags {
set enableLinkedAccounts(value: boolean) {
this._setBoolean('enableLinkedAccounts', value);
}

get enableAccountAbstraction() {
return this._getBoolean('enableAccountAbstraction', false);
}

set enableAccountAbstraction(value: boolean) {
this._setBoolean('enableAccountAbstraction', value);
}
}

export const featureFlags = new FeatureFlags();
Expand Down
5 changes: 1 addition & 4 deletions src/store/thirdweb/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { linkThirdwebWallet } from './api';
import { accountManager } from './account-manager';
import { getChain, getThirdWebClient } from '../../lib/web3/thirdweb/client';
import { setUser } from '../authentication';
import { featureFlags } from '../../lib/feature-flags';

export function* getLinkedThirdWebWallet() {
const currentUser = yield select(currentUserSelector());
Expand Down Expand Up @@ -103,9 +102,7 @@ function* listenForUserLogin() {
const userChannel = yield call(getAuthChannel);
while (true) {
yield take(userChannel, AuthEvents.UserLogin);
if (featureFlags.enableAccountAbstraction) {
yield call(initThirWebWallet);
}
yield call(initThirWebWallet);
}
}

Expand Down

0 comments on commit 084c281

Please sign in to comment.