fixes
- change refresh icon & apply refreshing logic - apply validation in action btn in menu - preserve on customer info state upon refresh
This commit is contained in:
@@ -113,6 +113,7 @@ export const CART_STORAGE_KEYS = {
|
||||
HIDDEN_SERVICES: "fascano_hidden_services",
|
||||
VISIBLE_SERVICES: "fascano_visible_services",
|
||||
ESTIMATE_WAY: "fascano_estimate_way",
|
||||
CUSTOMER_NAME: "fascano_customer_name",
|
||||
} as const;
|
||||
|
||||
// Utility functions for localStorage
|
||||
@@ -201,7 +202,7 @@ const initialState: CartState = {
|
||||
estimateWay: getFromLocalStorage(CART_STORAGE_KEYS.ESTIMATE_WAY, ""),
|
||||
order: getFromLocalStorage(CART_STORAGE_KEYS.ORDER, null),
|
||||
splitBillAmount: 0,
|
||||
customerName: "",
|
||||
customerName: getFromLocalStorage(CART_STORAGE_KEYS.CUSTOMER_NAME, ""),
|
||||
totalServices: 8,
|
||||
hiddenServices: 0,
|
||||
visibleServices: 0,
|
||||
@@ -701,6 +702,12 @@ const orderSlice = createSlice({
|
||||
},
|
||||
updateCustomerName(state, action: PayloadAction<string>) {
|
||||
state.customerName = action.payload;
|
||||
if (typeof window !== "undefined") {
|
||||
localStorage.setItem(
|
||||
CART_STORAGE_KEYS.CUSTOMER_NAME,
|
||||
JSON.stringify(state.customerName),
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user