Web: Fix: Error on additionalResources is null
This commit is contained in:
parent
94859dfd24
commit
81b8e0ce3b
@ -55,15 +55,15 @@ const AdditionalResources = (props) => {
|
||||
} = props;
|
||||
|
||||
const [feedbackAndSupportEnabled, setShowFeedback] = useState(
|
||||
additionalResourcesData.feedbackAndSupportEnabled
|
||||
additionalResourcesData?.feedbackAndSupportEnabled
|
||||
);
|
||||
|
||||
const [videoGuidesEnabled, setShowVideoGuides] = useState(
|
||||
additionalResourcesData.videoGuidesEnabled
|
||||
additionalResourcesData?.videoGuidesEnabled
|
||||
);
|
||||
|
||||
const [helpCenterEnabled, setShowHelpCenter] = useState(
|
||||
additionalResourcesData.helpCenterEnabled
|
||||
additionalResourcesData?.helpCenterEnabled
|
||||
);
|
||||
|
||||
const [hasChange, setHasChange] = useState(false);
|
||||
@ -77,9 +77,9 @@ const AdditionalResources = (props) => {
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setShowFeedback(additionalResourcesData.feedbackAndSupportEnabled);
|
||||
setShowVideoGuides(additionalResourcesData.videoGuidesEnabled);
|
||||
setShowHelpCenter(additionalResourcesData.helpCenterEnabled);
|
||||
setShowFeedback(additionalResourcesData?.feedbackAndSupportEnabled);
|
||||
setShowVideoGuides(additionalResourcesData?.videoGuidesEnabled);
|
||||
setShowHelpCenter(additionalResourcesData?.helpCenterEnabled);
|
||||
}, [additionalResourcesData]);
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -224,27 +224,29 @@ class ProfileActionsStore {
|
||||
const actionsArray = actions;
|
||||
|
||||
const feedbackAndSupportEnabled = this.authStore.settingsStore
|
||||
.additionalResourcesData.feedbackAndSupportEnabled;
|
||||
.additionalResourcesData?.feedbackAndSupportEnabled;
|
||||
const videoGuidesEnabled = this.authStore.settingsStore
|
||||
.additionalResourcesData.videoGuidesEnabled;
|
||||
.additionalResourcesData?.videoGuidesEnabled;
|
||||
const helpCenterEnabled = this.authStore.settingsStore
|
||||
.additionalResourcesData.helpCenterEnabled;
|
||||
.additionalResourcesData?.helpCenterEnabled;
|
||||
|
||||
if (!feedbackAndSupportEnabled) {
|
||||
const index = actionsArray.findIndex((item) => item.key === "SupportBtn");
|
||||
const index = actionsArray.findIndex(
|
||||
(item) => item?.key === "SupportBtn"
|
||||
);
|
||||
|
||||
actionsArray.splice(index, 1);
|
||||
}
|
||||
|
||||
if (!videoGuidesEnabled) {
|
||||
const index = actionsArray.findIndex((item) => item.key === "VideoBtn");
|
||||
const index = actionsArray.findIndex((item) => item?.key === "VideoBtn");
|
||||
|
||||
actionsArray.splice(index, 1);
|
||||
}
|
||||
|
||||
if (!helpCenterEnabled) {
|
||||
const index = actionsArray.findIndex(
|
||||
(item) => item.key === "HelpCenterBtn"
|
||||
(item) => item?.key === "HelpCenterBtn"
|
||||
);
|
||||
|
||||
actionsArray.splice(index, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user