Skip to content

Commit 4a9829d

Browse files
committed
fix(opencode): check all accounts for an unlock not just the primary USDF account
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 3b753da commit 4a9829d

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

services/opencode/src/main/kotlin/com/getcode/opencode/controllers/AccountController.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,10 @@ class AccountController @Inject constructor(
148148
throw error
149149
}
150150
}?.map { response ->
151-
val primary =
152-
response.accounts.values.find {
153-
it.accountType == AccountType.Primary && it.mint == Mint.usdf
154-
}
155-
156151
accounts.value = response.accounts.values.toList()
152+
val isUnlocked = response.accounts.any { it.value.unusable }
157153

158-
if (primary?.unusable == true) {
154+
if (isUnlocked) {
159155
onTimelockUnlocked()
160156
}
161157
}?.onSuccess {

0 commit comments

Comments
 (0)