mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
@@ -167,9 +167,10 @@ export const canDeactivateTabCleanup: CanDeactivateFn<unknown> = async () => {
|
||||
crmTabMetadataService.setSelectedPayerId(tabId, undefined);
|
||||
crmTabMetadataService.setSelectedShippingAddressId(tabId, undefined);
|
||||
|
||||
// Create new shopping cart for the cleaned tab
|
||||
const newShoppingCart = await shoppingCartService.createShoppingCart();
|
||||
checkoutMetadataService.setShoppingCartId(tabId, newShoppingCart.id);
|
||||
// Create new shopping cart and update Store (this automatically dispatches setShoppingCart action)
|
||||
await firstValueFrom(
|
||||
domainCheckoutService.createShoppingCart({ processId: tabId }),
|
||||
);
|
||||
|
||||
// Clear tab metadata and location history, but keep process_type for cart icon
|
||||
tabService.patchTabMetadata(tabId, { process_type: 'cart' });
|
||||
@@ -182,7 +183,6 @@ export const canDeactivateTabCleanup: CanDeactivateFn<unknown> = async () => {
|
||||
log.info('Tab reset to clean state', () => ({
|
||||
tabId,
|
||||
name: tabName,
|
||||
newShoppingCartId: newShoppingCart.id,
|
||||
}));
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user