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

Add 'ocr', 'scanner' and 'backup' features to isAvailable #988

Merged
merged 4 commits into from
Oct 23, 2023

Conversation

zatteo
Copy link
Contributor

@zatteo zatteo commented Oct 20, 2023

refactor: Support 'ocr' feature in isAvailable

We decided to move from isFeatureAvailable() to isAvailable(featureName: string) to check if a feature is available.

isOcrAvailable has not been released yet. So let's move it now before having to handle a breaking change.

refactor: Support 'scanner' and 'backup' feature in isAvailable

We decided to move from isFeatureAvailable() to
isAvailable(featureName: string) to check if a feature is available.

These feature have already been released in production. So I add the
possibility here to check if they are present by calling
isAvailable('scanner') or isAvailable('backup') but I do not remove
isScannerAvailable method and backup_available injected variable.

We will need to wait that the new isAvailable is released and
distributed to all of our users before removing the deprecated
methods.

We decided to move from isFeatureAvailable() to isAvailable(featureName: string) to check if a feature is available.

isOcrAvailable has not been released yet. So let's move it now before having to handle a breaking change.
We decided to move from isFeatureAvailable() to
isAvailable(featureName: string) to check if a feature is available.

These feature have already been released in production. So I add the
possibility here to check if they are present by calling
isAvailable('scanner') or isAvailable('backup') but I do not remove
isScannerAvailable method and backup_available injected variable.

We will need to wait that the new isAvailable is released and
distributed to all of our users before removing the deprecated
methods.
@@ -251,9 +257,8 @@ export const localMethods = (
openAppOSSettings,
isNativePassInstalledOnDevice,
scanDocument,
isScannerAvailable: () => Promise.resolve(isScannerAvailable()),
isScannerAvailable: () => Promise.resolve(isScannerAvailable()), // deprecated
Copy link
Member

Choose a reason for hiding this comment

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

maybe we can console log in this method to alert about deprectated method?

@zatteo zatteo merged commit 6fb601a into master Oct 23, 2023
1 check passed
@zatteo zatteo deleted the feat/migrate-is-available branch October 23, 2023 08:56
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.

2 participants