Skip to content

Commit

Permalink
fix: skip form tours on mobile (frappe#21180)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
ankush committed May 30, 2023
1 parent 77db84a commit ca85524
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions frappe/public/js/onboarding_tours/onboarding_tours.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ frappe.ui.OnboardingTour = class OnboardingTour {
};

frappe.ui.init_onboarding_tour = () => {
// As of now Tours are only for desktop as it is annoying on mobile.
// Also lot of elements are hidden on mobile so until we find a better way to do it.
if (!window.matchMedia("(min-device-width: 992px)").matches) return;

typeof frappe.boot.onboarding_tours == "undefined" && frappe.boot.onboarding_tours == [];
typeof frappe.boot.user.onboarding_status == "undefined" &&
frappe.boot.user.onboarding_status == {};
Expand Down Expand Up @@ -337,9 +341,7 @@ frappe.ui.init_onboarding_tour = () => {
}
}, 100);
};
// As of now Tours are only for desktop as it is annoying on mobile.
// Also lot of elements are hidden on mobile so until we find a better way to do it.
window.matchMedia("(min-device-width: 992px)").matches &&
frappe.router.on("change", () => {
frappe.ui.init_onboarding_tour();
});

frappe.router.on("change", () => {
frappe.ui.init_onboarding_tour();
});

0 comments on commit ca85524

Please sign in to comment.