diff --git a/package.json b/package.json index 6bff7c767..4fd167c03 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@capacitor/ios": "^5.7.3", "@capacitor/local-notifications": "^5.0.7", "@capacitor/status-bar": "^5.0.7", - "@escolalms/components": "^0.0.164", + "@escolalms/components": "^0.0.165", "@escolalms/h5p-react": "^0.2.19", "@escolalms/scorm-player": "^0.0.0", "@escolalms/sdk": "^1.0.0", diff --git a/src/components/Courses/Course/CoursePanelLayout/FinishPage/Rate/index.tsx b/src/components/Courses/Course/CoursePanelLayout/FinishPage/Rate/index.tsx index 2d07eb860..47b23b5fb 100644 --- a/src/components/Courses/Course/CoursePanelLayout/FinishPage/Rate/index.tsx +++ b/src/components/Courses/Course/CoursePanelLayout/FinishPage/Rate/index.tsx @@ -32,7 +32,7 @@ export const QuestionnairesModal = ({ }); const { settings } = useContext(EscolaLMSContext); const questionnaireFirstime = - settings?.value?.config[metaDataKeys.questionnaireFirstTimeMetaKey]; + settings?.value?.config?.[metaDataKeys?.questionnaireFirstTimeMetaKey]; interface StateType { show: boolean; diff --git a/src/components/_App/Navbar/index.tsx b/src/components/_App/Navbar/index.tsx index 50d37cccd..44268515b 100644 --- a/src/components/_App/Navbar/index.tsx +++ b/src/components/_App/Navbar/index.tsx @@ -291,9 +291,10 @@ const Navbar = () => { const bucket = VITE_APP_PUBLIC_IMG_BUCKET_FOLDER.replace(/^\/|\/$/g, ""); // e.g. "/wellms" // -> "wellms" // Full link, e.g. "https://randomdomain/somefolder/folder/testimg.jpg" - const url = settings.value.global.logo; + const url = settings?.value?.global?.logo; // 1. Extract pathname: "/wellms/avatars/testimg.jpg" + if (!url) return null; let relativePath = new URL(url).pathname; // 2. Remove the bucket prefix @@ -308,7 +309,7 @@ const Navbar = () => { } return relativePath; - }, [settings.value.global.logo]); + }, [settings?.value?.global?.logo]); const menuItems = [ {