Skip to content

Commit 30cf944

Browse files
refactor: use shorter kotlin unit instance
1 parent 06e21f3 commit 30cf944

File tree

1 file changed

+7
-5
lines changed
  • modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ of this software and associated documentation files (the "Software"), to deal
5454
import java.util.Map;
5555
import java.util.Objects;
5656

57+
import kotlin.Unit;
58+
5759
public class RCTCheckoutWebView extends FrameLayout {
5860
private static final String TAG = "RCTCheckoutWebView";
5961

@@ -118,7 +120,7 @@ public void setAuth(String authToken) {
118120
scheduleSetupIfNeeded();
119121
}
120122

121-
private void scheduleSetupIfNeeded() {
123+
private void scheduleSetupIfNeeded() {
122124
if (pendingSetup) {
123125
return;
124126
}
@@ -190,10 +192,10 @@ private void setupCheckoutWebView(String url, CheckoutConfiguration configuratio
190192
private CheckoutWebViewEventProcessor getCheckoutWebViewEventProcessor() {
191193
return new CheckoutWebViewEventProcessor(
192194
new CheckoutWebEventProcessor(),
193-
(visible) -> { return kotlin.Unit.INSTANCE; }, // toggleHeader
194-
(error) -> { return kotlin.Unit.INSTANCE; }, // closeCheckoutDialogWithError
195-
(visibility) -> { return kotlin.Unit.INSTANCE; }, // setProgressBarVisibility
196-
(percentage) -> { return kotlin.Unit.INSTANCE; } // updateProgressBarPercentage
195+
(visible) -> Unit.INSTANCE, // toggleHeader
196+
(error) -> Unit.INSTANCE, // closeCheckoutDialogWithError
197+
(visibility) -> Unit.INSTANCE, // setProgressBarVisibility
198+
(percentage) -> Unit.INSTANCE // updateProgressBarPercentage
197199
);
198200
}
199201

0 commit comments

Comments
 (0)