File tree Expand file tree Collapse file tree
superwall/src/main/java/com/superwall/sdk/identity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ data class IdentityState(
6060 ) : Reducer<IdentityState> {
6161 data class Identify (
6262 val userId : String ,
63+ val restoreAssignments : Boolean ,
6364 ) : Updates({ state ->
6465 val sanitized = IdentityLogic .sanitize(userId)
6566 if (sanitized.isNullOrEmpty() || sanitized == state.appUserId) {
@@ -88,8 +89,10 @@ data class IdentityState(
8889 base.copy(
8990 appUserId = sanitized,
9091 userAttributes = merged,
91- pending =
92- setOf(Pending .Seed , Pending .Assignments ),
92+ pending = buildSet {
93+ add(Pending .Seed )
94+ if (restoreAssignments) add(Pending .Assignments )
95+ },
9396 isReady = false,
9497 )
9598 }
@@ -211,7 +214,7 @@ data class IdentityState(
211214 }
212215
213216 // Update state (pure) — persistence handled by interceptor
214- update(Updates .Identify (sanitized))
217+ update(Updates .Identify (sanitized, options?.restorePaywallAssignments == true ))
215218
216219 val newState = state.value
217220 immediate(
You can’t perform that action at this time.
0 commit comments