Skip to content

Commit

Permalink
language_button.jsx do not display if course is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerum committed Dec 21, 2023
1 parent a918445 commit 8bcb51d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/app/(stories)/(main)/language_button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ let get_course = cache(async (id) => {
});

export default async function LanguageButton({ course_id, loading }) {
if(!course_id) {
return null
}
if (loading) {
return (
<div
Expand All @@ -41,14 +44,8 @@ export default async function LanguageButton({ course_id, loading }) {
);
}
let course = await get_course(course_id);
if (!course) {
return (
<div
className={
styles.language_select_button + " " + styles.animated_background
}
></div>
);
if(!course) {
return null
}
let localisation = await get_localisation(course.from_language);

Expand Down

0 comments on commit 8bcb51d

Please sign in to comment.