Skip to content

Commit 25d4098

Browse files
authored
[Patch 2.0.1] Fix issue with external links causing a crash (#78)
* Fix issue with external links causing a crash * Patch + changelog
1 parent 4fca5e4 commit 25d4098

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 2.0.1 - April 4, 2024
4+
5+
- Fixes an issue where opening `mailto` links externally causes the application
6+
to crash.
7+
38
## 2.0.0 - March 21, 2024
49

510
### Updated dependencies
@@ -16,7 +21,8 @@
1621
file on iOS, a `res/values/strings.xml` on Android or using the `title`
1722
attribute on the ShopifyCheckoutSheetKit configuration.
1823

19-
> [!IMPORTANT]
24+
<!-- prettier-ignore -->
25+
> [!IMPORTANT]
2026
> The `title` attribute on the configuration will configure iOS _only_.
2127
2228
```diff

modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ public void removeListeners(Integer count) {
7979
public void present(String checkoutURL) {
8080
Activity currentActivity = getCurrentActivity();
8181
if (currentActivity instanceof ComponentActivity) {
82-
Context appContext = getReactApplicationContext();
83-
DefaultCheckoutEventProcessor checkoutEventProcessor = new CustomCheckoutEventProcessor(appContext, this.reactContext);
82+
DefaultCheckoutEventProcessor checkoutEventProcessor = new CustomCheckoutEventProcessor(currentActivity,
83+
this.reactContext);
8484
currentActivity.runOnUiThread(() -> {
8585
ShopifyCheckoutSheetKit.present(checkoutURL, (ComponentActivity) currentActivity,
86-
checkoutEventProcessor);
86+
checkoutEventProcessor);
8787
});
8888
}
8989
}
@@ -174,7 +174,7 @@ private Colors createColorsFromConfig(ReadableMap config) {
174174
webViewBackground,
175175
headerBackground,
176176
headerFont,
177-
progressIndicator);
177+
progressIndicator);
178178
}
179179

180180
return null;

modules/@shopify/checkout-sheet-kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@shopify/checkout-sheet-kit",
33
"license": "MIT",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"main": "lib/commonjs/index.js",
66
"types": "src/index.ts",
77
"source": "src/index.ts",

0 commit comments

Comments
 (0)