Skip to content

Commit

Permalink
🪲 fix level dropdown in custom-adventure page (hedyorg#5660)
Browse files Browse the repository at this point in the history
fixing:

https://github.com/hedyorg/hedy/assets/20051470/fb007c32-43fc-4fc6-a04f-c8e5e2be5214


**How to test?**
- deselect all levels of an adventure,
- an alert about not selecting any level should appear
  • Loading branch information
hasan-sh authored Jul 10, 2024
1 parent 12cac75 commit 72f8253
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion static/js/appbundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -118475,7 +118475,10 @@ def note_with_error(value, err):
function get_formatted_content(content2, levels, language2) {
const parser19 = new DOMParser();
const html = parser19.parseFromString(content2, "text/html");
const minLevel = Math.min(...levels.map((el3) => Number(el3)));
let minLevel = 1;
if (levels.length) {
minLevel = Math.min(...levels.map((el3) => Number(el3)));
}
let snippets = [];
let snippetsFormatted = [];
let keywords2 = [];
Expand Down
4 changes: 2 additions & 2 deletions static/js/appbundle.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion static/js/teachers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ export function remove_student(class_id: string, student_id: string, prompt: str
function get_formatted_content(content: string, levels: string[], language: string) {
const parser = new DOMParser();
const html = parser.parseFromString(content, 'text/html');
const minLevel = Math.min(...levels.map((el) => Number(el)));
let minLevel = 1;
if (levels.length) {
minLevel = Math.min(...levels.map((el) => Number(el)));
}
let snippets: string[] = [] ;
let snippetsFormatted: string[] = [];
let keywords: string[] = []
Expand Down

0 comments on commit 72f8253

Please sign in to comment.