diff --git a/apps/storefront/.eslintrc.json b/apps/storefront/.eslintrc.json index d4d9bde1..39e06880 100644 --- a/apps/storefront/.eslintrc.json +++ b/apps/storefront/.eslintrc.json @@ -5,8 +5,7 @@ "files": [ "src/pages/**/*.{ts,tsx}", "src/utils/**/*.{ts,tsx}", - "src/components/**/*.{ts,tsx}", - "src/shared/**/**.*ts" + "src/components/**/*.{ts,tsx}" ], "rules": { "no-param-reassign": 0 diff --git a/apps/storefront/src/hooks/dom/useHideGoogleCustomerReviews.ts b/apps/storefront/src/hooks/dom/useHideGoogleCustomerReviews.ts index 4c5a5614..8c46fddb 100644 --- a/apps/storefront/src/hooks/dom/useHideGoogleCustomerReviews.ts +++ b/apps/storefront/src/hooks/dom/useHideGoogleCustomerReviews.ts @@ -21,8 +21,8 @@ const useHideGoogleCustomerReviews = ( const newVisibilityStyle = isOpen ? 'none' : 'inline-block' googleCustomerReviewsDoms.forEach((dom) => { - const d = dom - if (d?.parentElement) d.parentElement.style.display = newVisibilityStyle + const parentElement = dom?.parentElement + if (parentElement) parentElement.style.display = newVisibilityStyle }) }, [isOpen]) } diff --git a/apps/storefront/src/shared/dynamicallyVariable/context/index.ts b/apps/storefront/src/shared/dynamicallyVariable/context/index.ts index 58d5f595..5ad06f85 100644 --- a/apps/storefront/src/shared/dynamicallyVariable/context/index.ts +++ b/apps/storefront/src/shared/dynamicallyVariable/context/index.ts @@ -17,27 +17,31 @@ export const reducer = ( state: DynamicallyVariableState, action: Partial ) => { + const currentAction = action const setMulTip = () => { - if (action.type === 'tip' && action.payload?.tipMessage) { + if (currentAction.type === 'tip' && currentAction.payload?.tipMessage) { const msgs = state?.tipMessage?.msgs || [] const { tipMessage: { msgs: newMsgs = [] }, - } = action.payload + } = currentAction.payload - action.payload.tipMessage.msgs = [...msgs, ...newMsgs] + currentAction.payload.tipMessage.msgs = [...msgs, ...newMsgs] - return action.payload + return currentAction.payload } - if (action.type === 'globalTip' && action.payload?.globalTipMessage) { + if ( + currentAction.type === 'globalTip' && + currentAction.payload?.globalTipMessage + ) { const msgs = state?.globalTipMessage?.msgs || [] const { globalTipMessage: { msgs: newMsgs = [] }, - } = action.payload + } = currentAction.payload - action.payload.globalTipMessage.msgs = [...msgs, ...newMsgs] + currentAction.payload.globalTipMessage.msgs = [...msgs, ...newMsgs] return action.payload }