From 0cedeb08096fada0b755d7b10cbdf310a2c64674 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 13 Oct 2023 15:58:19 -0400 Subject: [PATCH] fix: default context for painted door experiment There are multiple places where attributes of the object provided by `usePaintedDoorExperimentContext()` are assumed to exist. This provides default (null) values for those attributes when creating the context. --- .../PaintedDoorExperimentContext.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/widgets/RecommendationsPaintedDoorBtn/PaintedDoorExperimentContext.jsx b/src/widgets/RecommendationsPaintedDoorBtn/PaintedDoorExperimentContext.jsx index 51e2c06..a88e0f2 100644 --- a/src/widgets/RecommendationsPaintedDoorBtn/PaintedDoorExperimentContext.jsx +++ b/src/widgets/RecommendationsPaintedDoorBtn/PaintedDoorExperimentContext.jsx @@ -68,7 +68,13 @@ export const useIsEnterpriseUser = () => { return enterpriseUser; }; -export const PaintedDoorExperimentContext = React.createContext(); +export const PaintedDoorExperimentContext = React.createContext({ + experimentVariation: null, + isPaintedDoorNavbarBtnVariation: null, + isPaintedDoorWidgetBtnVariation: null, + isPaintedDoorControlVariation: null, + experimentLoading: null, +}); export const PaintedDoorExperimentProvider = ({ children }) => { const [experimentData, setExperimentData] = module.state.experimentData({