web/satellite: clear payment account details on logout

this change clears the stored wallet, coupon and priceSummaryForSelectedProject on logout.

see: https://github.com/storj/storj/issues/5252

Change-Id: I2f51d727be97af9a0f26163bb3e93affa35dd2ee
This commit is contained in:
Wilfred Asomani 2022-10-19 11:38:18 +00:00 committed by Storj Robot
parent 149b59069f
commit 56128b972b
3 changed files with 7 additions and 1 deletions

View File

@ -64,6 +64,7 @@ import { AnalyticsHttpApi } from '@/api/analytics';
import { AnalyticsEvent } from '@/utils/constants/analyticsEventNames';
import { APP_STATE_MUTATIONS } from '@/store/mutationConstants';
import { MetaUtils } from '@/utils/meta';
import { PAYMENTS_ACTIONS } from '@/store/modules/payments';
import BillingIcon from '@/../static/images/navigation/billing.svg';
import InfoIcon from '@/../static/images/navigation/info.svg';
@ -150,6 +151,7 @@ export default class AccountArea extends Vue {
await this.$store.dispatch(BUCKET_ACTIONS.CLEAR);
await this.$store.dispatch(OBJECTS_ACTIONS.CLEAR);
await this.$store.dispatch(APP_STATE_ACTIONS.CLOSE_POPUPS);
await this.$store.dispatch(PAYMENTS_ACTIONS.CLEAR_PAYMENT_INFO);
LocalData.removeUserId();
}

View File

@ -485,6 +485,7 @@ export default class MobileNavigation extends Vue {
await this.$store.dispatch(BUCKET_ACTIONS.CLEAR);
await this.$store.dispatch(OBJECTS_ACTIONS.CLEAR);
await this.$store.dispatch(APP_STATE_ACTIONS.CLOSE_POPUPS);
await this.$store.dispatch(PAYMENTS_ACTIONS.CLEAR_PAYMENT_INFO);
LocalData.removeUserId();
}

View File

@ -205,13 +205,16 @@ export function makePaymentsModule(api: PaymentsApi): StoreModule<PaymentsState,
},
[CLEAR](state: PaymentsState) {
state.balance = new AccountBalance();
state.creditCards = [];
state.paymentsHistory = [];
state.nativePaymentsHistory = [];
state.usageAndCharges = [];
state.priceSummary = 0;
state.creditCards = [];
state.priceSummaryForSelectedProject = 0;
state.startDate = new Date();
state.endDate = new Date();
state.coupon = null;
state.wallet = new Wallet();
},
},
actions: {