fix init of browser & os details for questions #6738
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on mozilla/sumo#2397, I discovered that the initialization of the browser and OS details was failing for Firefox questions because the
AAQSystemInfo
JS class was looking fordesktop
rather thanfirefox
in the URL for creating new questions. Also, the details should only be initialized for mobile if the user is on a mobile device, and for desktop if on a desktop device, but when changingdesktop
tofirefox
, the details would be initialized when asking a question for Firefox Focus on a desktop OS becausefirefox
was found infocus-firefox
. I wrapped each of the cases with/.../
to resolve that and ensure complete matching.@emilghittasv Do we already have an issue for this? I couldn't find one, but before I create one I thought I'd ask you.