fix: ui issues

This commit is contained in:
Jannat Patel
2022-03-23 15:18:32 +05:30
parent a1895b1f78
commit 190dbab3d0
4 changed files with 19 additions and 60 deletions
+7 -6
View File
@@ -148,12 +148,13 @@ const rotate_chapter_icon = (e) => {
};
const show_no_preview_dialog = (e) => {
frappe.warn(__("Not available for preview"),
__("This lesson is not available for preview. Please join the course to access it."),
() => {
window.location.href = `/courses/${ $(e.currentTarget).data("course") }`
},
__("Start Learning"), false);
const d = frappe.warn(__("Not available for preview"),
__("This lesson is not available for preview. Please join the course to access it."),
() => {
const route = `/courses/${ $(e.currentTarget).data("course") }`;
window.location.pathname == route ? d.hide() : window.location.href = route;
},
__("Start Learning"), false);
};
</script>