You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added support for bitte-wallet in the callback URL handling logic.
Fixed minor formatting issues in the callback URL check conditions.
This adds support for the extra checks using execute method from @mintbase-js/sdk, on bitte-wallet too. it adds back again signMeta params with nfts metadata on it.
Changes walkthrough 📝
Relevant files
Bug fix
checkCallback.ts
Fix callback URL handling for `bitte-wallet`
packages/sdk/src/execute/checkCallback.ts
Added condition to check for bitte-wallet in addition to mintbase-wallet
Logical Error The new condition for shouldGetFromMbjs might lead to unexpected behavior as it checks for callbackUrl?.length < 1 or callbackUrl === undefined without proper grouping of conditions. This could result in shouldGetFromMbjs being true in unintended scenarios.
Add parentheses to ensure correct evaluation order in logical conditions
The logical condition in line 23 might not work as expected due to missing parentheses around the || condition. This could lead to unexpected behavior when checking callbackUrl properties. It's important to ensure that the entire condition for callbackUrl being undefined or having a length less than 1 is evaluated together.
Why: The suggestion correctly identifies a potential logical error due to operator precedence and provides a fix that ensures the condition is evaluated as intended, preventing unexpected behavior.
10
Maintainability
Simplify the condition by directly checking the property length
The condition window?.['mbjs']?.callbackUrl && window?.['mbjs']?.callbackUrl.length > 0 can be simplified by directly checking the length. This avoids redundancy and makes the code more readable.
Why: This suggestion improves code readability and maintainability by removing redundancy in the condition check, making it more concise and easier to understand.
9
Best practice
Use strict equality for comparison to avoid type coercion
The condition checking for the wallet ID should use strict equality (===) instead of loose equality (==) to avoid potential type coercion issues which might lead to unexpected behavior.
Why: Using strict equality is a best practice to avoid type coercion issues, which can lead to bugs. This suggestion improves code reliability.
8
Enhancement
Simplify the check for undefined or null values
The condition callbackUrl === undefined can be simplified to use !callbackUrl, which checks for both null and undefined, making the code cleaner and potentially catching more edge cases where callbackUrl might not be properly initialized.
Why: The suggestion simplifies the condition, making the code cleaner and potentially more robust by catching more edge cases. However, it slightly changes the logic order, which might not be necessary.
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.
PR Type
Bug fix
Description
bitte-wallet
in the callback URL handling logic.This adds support for the extra checks using
execute
method from@mintbase-js/sdk
, onbitte-wallet
too. it adds back again signMeta params with nfts metadata on it.Changes walkthrough 📝
checkCallback.ts
Fix callback URL handling for `bitte-wallet`
packages/sdk/src/execute/checkCallback.ts
bitte-wallet
in addition tomintbase-wallet