Refactor socket handling across components to support dual socket connections, enhancing data fetching capabilities and improving overall communication.

This commit is contained in:
seb
2025-07-03 05:36:41 +02:00
parent 1ed06804a0
commit 245f5067ed
19 changed files with 113 additions and 37 deletions

View File

@@ -67,8 +67,8 @@ class CartTab extends Component {
// @note Add method to fetch and apply order template prefill data
fetchOrderTemplate = () => {
if (this.context && this.context.connected) {
this.context.emit('getOrderTemplate', (response) => {
if (this.context && this.context.socket && this.context.socket.connected) {
this.context.socket.emit('getOrderTemplate', (response) => {
if (response.success && response.orderTemplate) {
const template = response.orderTemplate;
@@ -433,7 +433,7 @@ class CartTab extends Component {
{!showPaymentConfirmation && (
<CartDropdown
cartItems={cartItems}
socket={this.context}
socket={this.context.socket}
showDetailedSummary={showStripePayment}
deliveryMethod={deliveryMethod}
deliveryCost={deliveryCost}