Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added warnings to I-Need-Fuel page for users on unsupported devices (… #371

Merged
merged 3 commits into from
Sep 8, 2021

Conversation

EladKarni
Copy link
Contributor

<:bug::sparkles:> Implemented new logic for dealing with different devices

Added the ability to dynamically show errors or warnings depending on the device the user is accessing the website from.
PlayStation: Error
Xbox: Warning
Mobile (and anything else not web): Warning

Co-authored-by: Cameron Welter UncleClapton@users.noreply.github.com

Closes #354

Changelog

✨ Additions

  • added new npm package - ua-parser-js

⚡ Changes

  • Refactored the logic in I-Need-Fuel to accommodate for different types of errors and warnings depending on the user's device. We now use session.userAgent for the constructor of ua-parser-js to detect the user's device.

🔥 Removals

  • None

🐛 Fixes

  • A fix was also implemented to stop the userAgent from being an empty string if the user isn't logged in.

⚙ Tasks

  • N/A

Additional Information

Contributor's Checklist

  • This PR was created to resolve an existing issue or set of issues.
  • This PR satisfies any and all acceptance criteria laid out by issue(s) it resolves.
  • I have discussed creating this PR with the maintainers in the issue(s) beforehand.
  • I have thoroughly tested the changes this PR introduces in a local development environment.
  • I have linted the entire codebase using yarn lint and confirmed there are no errors or warnings.
  • I have followed the commit conventions laid out by CONTRIBUTING.md.

Maintainer's Checklist

  • User-facing changes this PR introduces has been or will be documented in CHANGELOG.md.
  • This PR has been linted and tested locally as a part of the review process.
  • All issues this PR resolves have been properly linked before merging.

…Mobile & Xbox).

Co-authored-by: Cameron Welter <UncleClapton@users.noreply.github.com>
message: `
It appears you're connecting from a mobile device.
Ensure your device's screen and browser remains active through the course of your rescue.
You may loose connection otherwise!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Lose connection", not loose. Also "throughout your rescue" is probably better language.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I shouldn't write things while tired AF

@UncleClapton UncleClapton self-assigned this Sep 7, 2021
Xbox: {
type: 'warn',
message: `
It appears you're connecting from a mobile device.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably read something like

It appears you're connecting from your Xbox!
While you may use the Xbox browser to use our services, we recommend using your computer to ensure a consistent connection.

UncleClapton
UncleClapton previously approved these changes Sep 8, 2021
@UncleClapton UncleClapton merged commit f3fd1cc into develop Sep 8, 2021
@UncleClapton UncleClapton deleted the feature/device-specific-warnings-and-errors branch September 8, 2021 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants