@@ -12,6 +12,7 @@ import com.getcode.opencode.model.core.ID
12
12
import com.getcode.opencode.model.core.NoId
13
13
import com.getcode.opencode.model.core.uuid
14
14
import com.getcode.services.opencode.BuildConfig
15
+ import com.getcode.solana.keys.base58
15
16
import com.google.firebase.ktx.Firebase
16
17
import com.google.firebase.messaging.ktx.messaging
17
18
import com.hoc081098.channeleventbus.ChannelEventBus
@@ -104,13 +105,14 @@ class UserManager @Inject constructor(
104
105
cluster = cluster,
105
106
)
106
107
}
108
+
109
+ associate()
107
110
}
108
111
109
112
fun set (accountId : ID ) {
110
113
_state .update {
111
114
it.copy(accountId = accountId)
112
115
}
113
- associate()
114
116
}
115
117
116
118
fun set (authState : AuthState ) {
@@ -137,8 +139,6 @@ class UserManager @Inject constructor(
137
139
if (userFlags?.isRegistered == true ) {
138
140
accountCluster?.let { eventBus.send(Events .OnLoggedIn (accountCluster!! )) }
139
141
}
140
-
141
- associate()
142
142
}
143
143
144
144
fun set (pushToken : String? ) {
@@ -155,11 +155,9 @@ class UserManager @Inject constructor(
155
155
}
156
156
}
157
157
158
- fun isSelf (id : ID ? ) = accountId == id
159
-
160
158
private fun associate () {
161
159
if (! BuildConfig .DEBUG ) {
162
- val distinctId = accountId?.uuid?.toString ()
160
+ val distinctId = accountCluster?.authorityPublicKey?.base58 ()
163
161
if (Bugsnag .isStarted()) {
164
162
Bugsnag .setUser(distinctId, null , " " )
165
163
}
0 commit comments