mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +00:00
Use user definition clearon events for billing (#8589)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { BILLING_DISK, KeyDefinition } from "../../platform/state";
|
import { BILLING_DISK, UserKeyDefinition } from "../../platform/state";
|
||||||
import { PaymentMethodWarning } from "../models/domain/payment-method-warning";
|
import { PaymentMethodWarning } from "../models/domain/payment-method-warning";
|
||||||
|
|
||||||
export const PAYMENT_METHOD_WARNINGS_KEY = KeyDefinition.record<PaymentMethodWarning>(
|
export const PAYMENT_METHOD_WARNINGS_KEY = UserKeyDefinition.record<PaymentMethodWarning>(
|
||||||
BILLING_DISK,
|
BILLING_DISK,
|
||||||
"paymentMethodWarnings",
|
"paymentMethodWarnings",
|
||||||
{
|
{
|
||||||
@@ -9,5 +9,6 @@ export const PAYMENT_METHOD_WARNINGS_KEY = KeyDefinition.record<PaymentMethodWar
|
|||||||
...warnings,
|
...warnings,
|
||||||
savedAt: new Date(warnings.savedAt),
|
savedAt: new Date(warnings.savedAt),
|
||||||
}),
|
}),
|
||||||
|
clearOn: ["logout"],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,19 +3,20 @@ import { map, Observable, of, switchMap } from "rxjs";
|
|||||||
import {
|
import {
|
||||||
ActiveUserState,
|
ActiveUserState,
|
||||||
BILLING_DISK,
|
BILLING_DISK,
|
||||||
KeyDefinition,
|
|
||||||
StateProvider,
|
StateProvider,
|
||||||
|
UserKeyDefinition,
|
||||||
} from "../../../platform/state";
|
} from "../../../platform/state";
|
||||||
import {
|
import {
|
||||||
BillingAccountProfile,
|
BillingAccountProfile,
|
||||||
BillingAccountProfileStateService,
|
BillingAccountProfileStateService,
|
||||||
} from "../../abstractions/account/billing-account-profile-state.service";
|
} from "../../abstractions/account/billing-account-profile-state.service";
|
||||||
|
|
||||||
export const BILLING_ACCOUNT_PROFILE_KEY_DEFINITION = new KeyDefinition<BillingAccountProfile>(
|
export const BILLING_ACCOUNT_PROFILE_KEY_DEFINITION = new UserKeyDefinition<BillingAccountProfile>(
|
||||||
BILLING_DISK,
|
BILLING_DISK,
|
||||||
"accountProfile",
|
"accountProfile",
|
||||||
{
|
{
|
||||||
deserializer: (billingAccountProfile) => billingAccountProfile,
|
deserializer: (billingAccountProfile) => billingAccountProfile,
|
||||||
|
clearOn: ["logout"],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user