Skip to content

Commit fef43f5

Browse files
authored
fix: remove the staking portfolio persistence modal (#1572)
* feat: remove the staking portfolio persistence modal * test(extension): remove outdated step
1 parent bdf7d29 commit fef43f5

File tree

19 files changed

+6
-131
lines changed

19 files changed

+6
-131
lines changed

apps/browser-extension-wallet/src/features/delegation/components/MultiDelegationStakingPopup.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { useWalletActivities } from '@hooks/useWalletActivities';
2222
import {
2323
MULTIDELEGATION_DAPP_COMPATIBILITY_LS_KEY,
2424
MULTIDELEGATION_FIRST_VISIT_LS_KEY,
25-
MULTIDELEGATION_FIRST_VISIT_SINCE_PORTFOLIO_PERSISTENCE_LS_KEY,
2625
STAKING_BROWSER_PREFERENCES_LS_KEY
2726
} from '@utils/constants';
2827
import { withSignTxConfirmation } from '@lib/wallet-api-ui';
@@ -104,10 +103,6 @@ export const MultiDelegationStakingPopup = (): JSX.Element => {
104103
);
105104
const [multidelegationDAppCompatibility, { updateLocalStorage: setMultidelegationDAppCompatibility }] =
106105
useLocalStorage(MULTIDELEGATION_DAPP_COMPATIBILITY_LS_KEY, true);
107-
const [
108-
multidelegationFirstVisitSincePortfolioPersistence,
109-
{ updateLocalStorage: setMultidelegationFirstVisitSincePortfolioPersistence }
110-
] = useLocalStorage(MULTIDELEGATION_FIRST_VISIT_SINCE_PORTFOLIO_PERSISTENCE_LS_KEY, true);
111106

112107
const [stakingBrowserPreferencesPersistence, { updateLocalStorage: setStakingBrowserPreferencesPersistence }] =
113108
useLocalStorage(STAKING_BROWSER_PREFERENCES_LS_KEY, DEFAULT_STAKING_BROWSER_PREFERENCES);
@@ -127,14 +122,11 @@ export const MultiDelegationStakingPopup = (): JSX.Element => {
127122
stakingBrowserPreferencesPersistence,
128123
setStakingBrowserPreferencesPersistence,
129124
multidelegationFirstVisit,
130-
triggerMultidelegationFirstVisit: () => setMultidelegationFirstVisit(false),
131-
multidelegationDAppCompatibility,
132-
triggerMultidelegationDAppCompatibility: () => setMultidelegationDAppCompatibility(false),
133-
multidelegationFirstVisitSincePortfolioPersistence,
134-
triggerMultidelegationFirstVisitSincePortfolioPersistence: () => {
125+
triggerMultidelegationFirstVisit: () => {
135126
setMultidelegationFirstVisit(false);
136-
setMultidelegationFirstVisitSincePortfolioPersistence(false);
137127
},
128+
multidelegationDAppCompatibility,
129+
triggerMultidelegationDAppCompatibility: () => setMultidelegationDAppCompatibility(false),
138130
expandStakingView: (urlSearchParams?: string) =>
139131
handleOpenBrowser({ section: BrowserViewSections.STAKING, urlSearchParams }),
140132
balancesBalance: balance,

apps/browser-extension-wallet/src/hooks/__tests__/useWalletManager.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,7 @@ describe('Testing useWalletManager hook', () => {
580580
'hideBalance',
581581
'isForgotPasswordFlow',
582582
'multidelegationFirstVisit',
583-
'isMultiDelegationDAppCompatibilityModalVisible',
584-
'multidelegationFirstVisitSincePortfolioPersistence'
583+
'isMultiDelegationDAppCompatibilityModalVisible'
585584
]
586585
});
587586
expect(clearBackgroundStorage).toBeCalledWith({

apps/browser-extension-wallet/src/hooks/useWalletManager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,7 @@ export const useWalletManager = (): UseWalletManager => {
698698
'hideBalance',
699699
'isForgotPasswordFlow',
700700
'multidelegationFirstVisit',
701-
'isMultiDelegationDAppCompatibilityModalVisible',
702-
'multidelegationFirstVisitSincePortfolioPersistence'
701+
'isMultiDelegationDAppCompatibilityModalVisible'
703702
];
704703

705704
if (isForgotPasswordFlow) {

apps/browser-extension-wallet/src/types/local-storage.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export interface ILocalStorage {
5959
isForgotPasswordFlow?: boolean;
6060
multidelegationFirstVisit?: boolean;
6161
isMultiDelegationDAppCompatibilityModalVisible?: boolean;
62-
multidelegationFirstVisitSincePortfolioPersistence?: boolean;
6362
unconfirmedTransactions: UnconfirmedTransaction[];
6463
stakingBrowserPreferences: StakingBrowserPreferences;
6564
showPinExtension?: boolean;

apps/browser-extension-wallet/src/utils/constants.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export const cardanoCoin: Wallet.CoinId = {
1616
symbol: CARDANO_COIN_SYMBOL[Wallet.Cardano.NetworkId.Mainnet]
1717
};
1818

19-
export const EPOCH_DURATION_DAYS = 5;
20-
2119
export const MIN_COIN_TO_SEND = 1;
2220

2321
export const COLLATERAL_ADA_AMOUNT = 5;
@@ -114,8 +112,6 @@ export const SEND_NFT_DEFAULT_AMOUNT = '1';
114112

115113
export const COINGECKO_URL = 'https://www.coingecko.com';
116114

117-
export const MULTIDELEGATION_FIRST_VISIT_SINCE_PORTFOLIO_PERSISTENCE_LS_KEY =
118-
'multidelegationFirstVisitSincePortfolioPersistence';
119115
export const MULTIDELEGATION_FIRST_VISIT_LS_KEY = 'multidelegationFirstVisit';
120116
export const MULTIDELEGATION_DAPP_COMPATIBILITY_LS_KEY = 'isMultiDelegationDAppCompatibilityModalVisible';
121117
export const STAKING_BROWSER_PREFERENCES_LS_KEY = 'stakingBrowserPreferences';

apps/browser-extension-wallet/src/views/browser-view/features/staking/components/StakingContainer.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { useBalances, useCustomSubmitApi, useFetchCoinPrice, useLocalStorage, us
1515
import {
1616
MULTIDELEGATION_DAPP_COMPATIBILITY_LS_KEY,
1717
MULTIDELEGATION_FIRST_VISIT_LS_KEY,
18-
MULTIDELEGATION_FIRST_VISIT_SINCE_PORTFOLIO_PERSISTENCE_LS_KEY,
1918
STAKING_BROWSER_PREFERENCES_LS_KEY
2019
} from '@utils/constants';
2120
import { useDelegationStore } from '@src/features/delegation/stores';
@@ -35,10 +34,6 @@ export const StakingContainer = (): React.ReactElement => {
3534
);
3635
const [multidelegationDAppCompatibility, { updateLocalStorage: setMultidelegationDAppCompatibility }] =
3736
useLocalStorage(MULTIDELEGATION_DAPP_COMPATIBILITY_LS_KEY, true);
38-
const [
39-
multidelegationFirstVisitSincePortfolioPersistence,
40-
{ updateLocalStorage: setMultidelegationFirstVisitSincePortfolioPersistence }
41-
] = useLocalStorage(MULTIDELEGATION_FIRST_VISIT_SINCE_PORTFOLIO_PERSISTENCE_LS_KEY, true);
4237
const sendAnalytics = useCallback(() => {
4338
// TODO implement analytics for the new flow
4439
const an = {
@@ -142,11 +137,6 @@ export const StakingContainer = (): React.ReactElement => {
142137
triggerMultidelegationFirstVisit: () => setMultidelegationFirstVisit(false),
143138
multidelegationDAppCompatibility,
144139
triggerMultidelegationDAppCompatibility: () => setMultidelegationDAppCompatibility(false),
145-
multidelegationFirstVisitSincePortfolioPersistence,
146-
triggerMultidelegationFirstVisitSincePortfolioPersistence: () => {
147-
setMultidelegationFirstVisit(false);
148-
setMultidelegationFirstVisitSincePortfolioPersistence(false);
149-
},
150140
walletAddress,
151141
walletName,
152142
currentChain,

packages/e2e-tests/src/features/MultidelegationDelegatedFundsMultiplePoolsPopup.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ Feature: Staking Page - Delegated funds - Multiple pools - Popup View
66

77
@LW-8330
88
Scenario: Popup View - Delegation card displays correct data
9-
And I disable showing Multidelegation persistence banner
109
When I navigate to Staking popup page
1110
Then I see Delegation title displayed for multidelegation
1211
And I see Delegation card displaying correct data
1312

1413
@LW-8338
1514
Scenario: Popup View - Delegated pools cards are present
16-
And I disable showing Multidelegation persistence banner
1715
When I navigate to Staking popup page
1816
And I see Delegation pool cards are displayed
1917

packages/e2e-tests/src/features/MultidelegationDelegatedFundsSinglePoolPopup.feature

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ Feature: Staking Page - Delegated funds - Single pool - Popup View
66

77
@LW-8330
88
Scenario: Popup View - Delegation card displays correct data
9-
And I disable showing Multidelegation persistence banner
109
When I navigate to Staking popup page
1110
Then I see Delegation title displayed for multidelegation
1211
And I see Delegation card displaying correct data
1312

1413
@LW-8338
1514
Scenario: Popup View - Delegated pools cards are present
16-
And I disable showing Multidelegation persistence banner
1715
When I navigate to Staking popup page
1816
And I see Delegation pool cards are displayed
1917

packages/e2e-tests/src/features/NetworkSwitchingExtended.feature

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Feature: LW: Network Switching - extended view
44
Background:
55
Given Wallet is synced
66
And I disable showing Multidelegation beta banner
7-
And I disable showing Multidelegation persistence banner
87

98
@LW-3226
109
Scenario Outline: Extended View - Currency symbol is correct when on different network - <network> <ticker>

packages/e2e-tests/src/fixture/localStorageInitializer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ class LocalStorageInitializer {
3636
await localStorageManager.setItem('multidelegationFirstVisit', 'false');
3737
};
3838

39-
disableShowingMultidelegationPersistenceBanner = async () => {
40-
await localStorageManager.setItem('multidelegationFirstVisitSincePortfolioPersistence', 'false');
41-
};
42-
4339
enableShowingAnalyticsBanner = async () => {
4440
await localStorageManager.setItem('analyticsStatus', '');
4541
};

packages/e2e-tests/src/hooks/beforeTagHooks.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Before(
4444
async () => {
4545
await extendedViewRepositoryWalletInitialization([TestWalletName.TestAutomationWallet]);
4646
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
47-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
4847
}
4948
);
5049

@@ -55,7 +54,6 @@ Before(
5554
async () => {
5655
await popupViewRepositoryWalletInitialization([TestWalletName.TestAutomationWallet]);
5756
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
58-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
5957
}
6058
);
6159

@@ -122,7 +120,6 @@ Before(
122120
Before({ tags: '@Staking-DelegatedFunds-Popup or @NetworkSwitching-popup' }, async () => {
123121
await popupViewRepositoryWalletInitialization([TestWalletName.TAWalletDelegatedFunds]);
124122
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
125-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
126123
});
127124

128125
Before(
@@ -248,7 +245,6 @@ Before(
248245
async () => {
249246
await extendedViewRepositoryWalletInitialization([TestWalletName.MultiAccActive1]);
250247
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
251-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
252248
}
253249
);
254250

@@ -259,7 +255,6 @@ Before(
259255
async () => {
260256
await popupViewRepositoryWalletInitialization([TestWalletName.MultiAccActive1]);
261257
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
262-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
263258
}
264259
);
265260

@@ -268,7 +263,6 @@ Before(
268263
async () => {
269264
await extendedViewRepositoryWalletInitialization([TestWalletName.AddNewWallet]);
270265
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
271-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
272266
await localStorageInitializer.initializeShowMultiAddressDiscoveryModal(false);
273267
await localStorageInitializer.disableShowPinExtension();
274268
}

packages/e2e-tests/src/steps/commonSteps.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ Given(/^I disable showing Multidelegation beta banner$/, async () => {
332332
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
333333
});
334334

335-
Given(/^I disable showing Multidelegation persistence banner$/, async () => {
336-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
337-
});
338-
339335
Given(/^I disable showing Multidelegation DApps issue modal$/, async () => {
340336
await localStorageInitializer.disableShowingMultidelegationDAppsIssueModal();
341337
});

packages/e2e-tests/src/steps/multidelegationSteps.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ Given(/^I am on Start Staking page in (extended|popup) mode$/, async (mode: 'ext
345345
await TokensPage.waitUntilCardanoTokenLoaded();
346346
await TokensPage.saveTokenBalance('Cardano');
347347
await localStorageInitializer.disableShowingMultidelegationBetaBanner();
348-
await localStorageInitializer.disableShowingMultidelegationPersistenceBanner();
349348
await mainMenuPageObject.navigateToSection('Staking', mode);
350349
const cardanoBalance = String(await TokensPage.loadTokenBalance('Cardano'));
351350
await StartStakingPageAssert.assertSeeStartStakingPage(cardanoBalance, mode);

packages/staking/.storybook/StakingStorybookProvider.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ const outsideHandlesMocks: OutsideHandlesContextValue = {
4545
triggerMultidelegationFirstVisit: undefined,
4646
multidelegationDAppCompatibility: undefined,
4747
triggerMultidelegationDAppCompatibility: undefined,
48-
multidelegationFirstVisitSincePortfolioPersistence: undefined,
49-
triggerMultidelegationFirstVisitSincePortfolioPersistence: undefined,
5048
walletAddress: undefined,
5149
walletName: undefined,
5250
currentChain: undefined,

packages/staking/src/features/modals/PortfolioPersistenceModal.tsx

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
export { ChangingPreferencesModal } from './ChangingPreferencesModal';
22
export { MultidelegationBetaModal } from './MultidelegationBetaModal';
33
export { PoolsManagementModal, PoolsManagementModalType } from './PoolsManagementModal';
4-
export { PortfolioPersistenceModal } from './PortfolioPersistenceModal';

packages/staking/src/features/outside-handles-provider/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ export type OutsideHandlesContextValue = {
9797
triggerMultidelegationFirstVisit: () => void;
9898
multidelegationDAppCompatibility: boolean;
9999
triggerMultidelegationDAppCompatibility: () => void;
100-
multidelegationFirstVisitSincePortfolioPersistence: boolean;
101-
triggerMultidelegationFirstVisitSincePortfolioPersistence: () => void;
102100
walletAddress: string;
103101
walletName: string;
104102
currentChain: Wallet.Cardano.ChainId;
Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { MultidelegationDAppCompatibilityModal } from 'features/modals/MultidelegationDAppCompatibilityModal';
22
import { useDelegationPortfolioStore } from 'features/store';
3-
import { isPortfolioSavedOnChain } from 'features/store/delegationPortfolioStore/isPortfolioSavedOnChain';
43
import { useEffect } from 'react';
5-
import { MultidelegationBetaModal, PortfolioPersistenceModal } from '../modals';
4+
import { MultidelegationBetaModal } from '../modals';
65
import { useOutsideHandles } from '../outside-handles-provider';
76

87
type OneTimeModalManagerProps = { popupView?: boolean };
@@ -13,14 +12,11 @@ export const OneTimeModals = ({ popupView }: OneTimeModalManagerProps) => {
1312
triggerMultidelegationFirstVisit,
1413
multidelegationDAppCompatibility,
1514
triggerMultidelegationDAppCompatibility,
16-
multidelegationFirstVisitSincePortfolioPersistence,
17-
triggerMultidelegationFirstVisitSincePortfolioPersistence,
1815
} = useOutsideHandles();
1916
const { currentPortfolio } = useDelegationPortfolioStore((store) => ({
2017
currentPortfolio: store.currentPortfolio,
2118
}));
2219
const userAlreadyMultidelegated = currentPortfolio.length > 1;
23-
const portfolioSavedOnChain = isPortfolioSavedOnChain(currentPortfolio);
2420

2521
// the useEffects below prevent the modals from appearing to the user in the future e.g. after undelegating the portfolio
2622
useEffect(() => {
@@ -29,16 +25,6 @@ export const OneTimeModals = ({ popupView }: OneTimeModalManagerProps) => {
2925
}
3026
}, [userAlreadyMultidelegated, multidelegationFirstVisit, triggerMultidelegationFirstVisit]);
3127

32-
useEffect(() => {
33-
if (multidelegationFirstVisitSincePortfolioPersistence && portfolioSavedOnChain) {
34-
triggerMultidelegationFirstVisitSincePortfolioPersistence();
35-
}
36-
}, [
37-
multidelegationFirstVisitSincePortfolioPersistence,
38-
triggerMultidelegationFirstVisitSincePortfolioPersistence,
39-
portfolioSavedOnChain,
40-
]);
41-
4228
if (!userAlreadyMultidelegated) {
4329
return (
4430
<MultidelegationBetaModal
@@ -59,15 +45,5 @@ export const OneTimeModals = ({ popupView }: OneTimeModalManagerProps) => {
5945
);
6046
}
6147

62-
if (!portfolioSavedOnChain) {
63-
return (
64-
<PortfolioPersistenceModal
65-
visible={multidelegationFirstVisitSincePortfolioPersistence}
66-
onConfirm={triggerMultidelegationFirstVisitSincePortfolioPersistence}
67-
popupView={popupView}
68-
/>
69-
);
70-
}
71-
7248
return null;
7349
};

packages/translation/src/lib/translations/staking/en.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@
146146
"modals.beta.button": "Got it",
147147
"modals.beta.description": "This feature allows you to stake to up to {{maxPools}} pools. This is still in beta version, so some functionality might not be available. Read more about multi-delegation in our <Link>dedicated blog.</Link>",
148148
"modals.beta.pill": "Beta",
149-
"modals.beta.portfolioPersistence.description": "Lace now supports on-chain portfolio persistence! This feature helps protect portfolios from significant drift and ensures cross-device syncing. If you've previously submitted a delegation, please resubmit your current (or a new) delegation to enable on-chain portfolio persistence.",
150-
"modals.beta.portfolioPersistence.title": "Multi-delegation: Portfolio Persistence",
151149
"modals.beta.title": "Multi-delegation",
152150
"modals.changingPreferences.buttons.cancel": "Cancel",
153151
"modals.changingPreferences.buttons.confirm": "Fine by me",

0 commit comments

Comments
 (0)