Skip to content

Commit

Permalink
fix(dynamic-links, android): avoid double-consuming WritableMap
Browse files Browse the repository at this point in the history
put the UTM Parameters initialization local to where it may be used,
this way regardless of execution path it's always fresh and will
not be consumed twice

Fixes #5812
  • Loading branch information
mikehardy committed Oct 25, 2021
1 parent 93109ec commit 514e6bd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public class ReactNativeFirebaseDynamicLinksModule extends ReactNativeFirebaseMo

private String initialLinkUrl = null;
private int initialLinkMinimumVersion = 0;
private WritableMap initialLinkUtmParameters = new WritableNativeMap();

/** Ensures calls to getInitialLink only tries to retrieve the link from getDynamicLink once. */
private boolean gotInitialLink = false;
Expand Down Expand Up @@ -183,6 +182,7 @@ public void getInitialLink(Promise promise) {
// cleared.
gotInitialLink = true;
PendingDynamicLinkData pendingDynamicLinkData = task.getResult();
WritableMap initialLinkUtmParameters = new WritableNativeMap();

if (pendingDynamicLinkData != null) {
initialLinkUrl = pendingDynamicLinkData.getLink().toString();
Expand Down

1 comment on commit 514e6bd

@vercel
Copy link

@vercel vercel bot commented on 514e6bd Oct 25, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.