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

refactor: Move the logic for detecting supported browsers for a wallet to core package #738

Conversation

kujtimprenkuSQA
Copy link
Collaborator

@kujtimprenkuSQA kujtimprenkuSQA commented Mar 22, 2023

Description

This PR is about moving the logic for detecting the browser which an injected(extension) wallet supports to the core package so we can reuse it in other packages.

The initial work was done as part of the previous PR: #735

This introduces a new helper function isCurrentBrowserSupported that accepts the list of browsers that a wallet supports, the goal is to show a wallet only on the browsers that is supported.

The injected wallets will need to update the code to something like this in the setup function:

const mobile = isMobile();
const isSupported = isCurrentBrowserSupported(["chrome", "edge-chromium", "opera"]); 

if (mobile || !isSupported ) {
   return null;
}

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Type of change.

  • FIX - a PR of this type patches a bug.
  • FEATURE - a PR of this type introduces a new feature.
  • BUILD - a PR of this type introduces build changes.
  • CI - a PR of this type introduces CI changes.
  • DOCS - a PR of this type introduces DOCS improvement.
  • STYLE - a PR of this type introduces style changes.
  • REFACTOR - a PR of this type introduces refactoring.
  • PERFORMANCE - a PR of this type introduces performance changes.
  • TEST - a PR of this type adds more tests.
  • CHORE - a PR introduces other changes than the specified above.

@github-actions github-actions bot changed the title Move the logic for detecting supported browsers for a wallet to core package refactor: Move the logic for detecting supported browsers for a wallet to core package Mar 22, 2023
DamirSQA
DamirSQA previously approved these changes Mar 22, 2023
Copy link
Contributor

@hcho112 hcho112 left a comment

Choose a reason for hiding this comment

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

minor change request. In terms of name of the helper function, I'm open to suggestion as well.

Copy link
Contributor

@hcho112 hcho112 left a comment

Choose a reason for hiding this comment

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

LGTM

@kujtimprenkuSQA kujtimprenkuSQA merged commit d4d9da7 into dev Mar 24, 2023
@kujtimprenkuSQA kujtimprenkuSQA deleted the SQC-488/move-the-logic-for-detecting-supported-browsers-for-a-wallet-to-core-package branch March 24, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants