Skip to content
Merged

fix #556

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/components/_App/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -308,7 +309,7 @@ const Navbar = () => {
}

return relativePath;
}, [settings.value.global.logo]);
}, [settings?.value?.global?.logo]);

const menuItems = [
{
Expand Down
Loading