Skip to content

Commit bf031b8

Browse files
committed
chore(flipcash): update distinct identifier for bugsnag/mixpanel
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent ece91bc commit bf031b8

File tree

1 file changed

+4
-6
lines changed
  • services/flipcash/src/main/kotlin/com/flipcash/services/user

1 file changed

+4
-6
lines changed

services/flipcash/src/main/kotlin/com/flipcash/services/user/UserManager.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import com.getcode.opencode.model.core.ID
1212
import com.getcode.opencode.model.core.NoId
1313
import com.getcode.opencode.model.core.uuid
1414
import com.getcode.services.opencode.BuildConfig
15+
import com.getcode.solana.keys.base58
1516
import com.google.firebase.ktx.Firebase
1617
import com.google.firebase.messaging.ktx.messaging
1718
import com.hoc081098.channeleventbus.ChannelEventBus
@@ -104,13 +105,14 @@ class UserManager @Inject constructor(
104105
cluster = cluster,
105106
)
106107
}
108+
109+
associate()
107110
}
108111

109112
fun set(accountId: ID) {
110113
_state.update {
111114
it.copy(accountId = accountId)
112115
}
113-
associate()
114116
}
115117

116118
fun set(authState: AuthState) {
@@ -137,8 +139,6 @@ class UserManager @Inject constructor(
137139
if (userFlags?.isRegistered == true) {
138140
accountCluster?.let { eventBus.send(Events.OnLoggedIn(accountCluster!!)) }
139141
}
140-
141-
associate()
142142
}
143143

144144
fun set(pushToken: String?) {
@@ -155,11 +155,9 @@ class UserManager @Inject constructor(
155155
}
156156
}
157157

158-
fun isSelf(id: ID?) = accountId == id
159-
160158
private fun associate() {
161159
if (!BuildConfig.DEBUG) {
162-
val distinctId = accountId?.uuid?.toString()
160+
val distinctId = accountCluster?.authorityPublicKey?.base58()
163161
if (Bugsnag.isStarted()) {
164162
Bugsnag.setUser(distinctId, null, "")
165163
}

0 commit comments

Comments
 (0)