Skip to content

Commit a141bc3

Browse files
feat: v11.8.1 (#1491): hide CrowdNode Online Account button if online account is connected
* fix(crowdnode): hide CrowdNode Online Account button if online account is connected * chore: v11.8.1
1 parent ccfd04a commit a141bc3

4 files changed

Lines changed: 48 additions & 17 deletions

File tree

integrations/crowdnode/CLAUDE.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ transitions.
136136
## Temporarily Disabled Functionality (withdrawals only)
137137

138138
CrowdNode has been intentionally **restricted to withdrawals only**. Deposits, linking an existing
139-
account, and creating an online account are hidden in the UI so that users can still get their funds
140-
**out**, but cannot put new funds **in** or set up new account linkages. Withdrawals are deliberately
141-
left fully working.
139+
account, and the online account (including opening an already fully linked one) are hidden in the UI
140+
so that users can still get their funds **out**, but cannot put new funds **in** or set up/use account
141+
linkages. Withdrawals are deliberately left fully working.
142142

143143
This was done purely at the **UI layer** (hiding buttons), not by removing any API/blockchain logic —
144144
so the disabled flows can be restored by reverting two files. Introduced in commit
@@ -159,16 +159,21 @@ so the disabled flows can be restored by reverting two files. Introduced in comm
159159
```kotlin
160160
// CrowdNode functionality is limited: deposits aren't supported. Only withdrawals are allowed.
161161
binding.depositBtn.isVisible = false
162-
// hidden unless the online account is fully set up - see setOnlineAccountStatus
162+
// online account isn't supported - the button is kept hidden in all states, see setOnlineAccountStatus
163163
binding.onlineAccountBtn.isVisible = false
164164
```
165-
And in `setOnlineAccountStatus(...)` the online-account button is only shown once an online
166-
account is fully set up (`OnlineAccountStatus.Done`), instead of during linking/creation:
165+
And in `setOnlineAccountStatus(...)` the online-account button is kept hidden in **all** states,
166+
including a fully set up online account (`OnlineAccountStatus.Done`):
167167
```kotlin
168-
// CrowdNode functionality is limited: creating an online account isn't
169-
// supported. The button is only shown for fully set up online accounts.
170-
binding.onlineAccountBtn.isVisible = status == OnlineAccountStatus.Done
168+
// CrowdNode functionality is limited: only withdrawals are supported. The online
169+
// account button is hidden in all states, including fully set up online accounts.
170+
binding.onlineAccountBtn.isVisible = false
171171
```
172+
> Earlier (v11.8/v11.8.1) this line was `isVisible = status == OnlineAccountStatus.Done`, which
173+
> re-showed the button for fully linked online accounts. Tapping it called
174+
> `CrowdNodeViewModel.getAccountUrl()`, which does `primaryDashAddress!!` — null for accounts
175+
> linked before the primary address was persisted — causing a `NullPointerException` crash.
176+
> Hiding the button unconditionally removes both the unsupported flow and that crash path.
172177
173178
3. The **Withdraw** button (`withdrawBtn``continueWithdraw()`) was **not** modified — withdrawals
174179
remain fully enabled.
@@ -206,8 +211,10 @@ To re-enable manually instead, reverse each change above:
206211
}
207212
```
208213
- **PortalFragment.kt (`setOnlineAccountStatus`)** — delete the added
209-
`binding.onlineAccountBtn.isVisible = status == OnlineAccountStatus.Done` line so the button's
210-
visibility is governed only by the original linking-progress logic.
214+
`binding.onlineAccountBtn.isVisible = false` line so the button's visibility is governed only by
215+
the original linking-progress logic. (Do **not** restore the intermediate
216+
`isVisible = status == OnlineAccountStatus.Done` form — that variant crashed on a null
217+
`primaryDashAddress`; see the note in *What was changed* above.)
211218

212219
> Note: deposit/withdraw share the same `TransferFragment` (`portalToTransfer(isWithdraw)`), and all
213220
> the underlying API/blockchain logic for deposits and account linking is still present and untouched.

integrations/crowdnode/src/main/java/org/dash/wallet/integrations/crowdnode/ui/portal/PortalFragment.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class PortalFragment : Fragment(R.layout.fragment_portal) {
136136

137137
// CrowdNode functionality is limited: deposits aren't supported. Only withdrawals are allowed.
138138
binding.depositBtn.isVisible = false
139-
// hidden unless the online account is fully set up - see setOnlineAccountStatus
139+
// online account isn't supported - the button is kept hidden in all states, see setOnlineAccountStatus
140140
binding.onlineAccountBtn.isVisible = false
141141

142142
binding.withdrawBtn.setOnClickListener {
@@ -259,9 +259,10 @@ class PortalFragment : Fragment(R.layout.fragment_portal) {
259259
}
260260

261261
private fun setOnlineAccountStatus(status: OnlineAccountStatus) {
262-
// CrowdNode functionality is limited: creating an online account isn't
263-
// supported. The button is only shown for fully set up online accounts.
264-
binding.onlineAccountBtn.isVisible = status == OnlineAccountStatus.Done
262+
// CrowdNode functionality is limited: only withdrawals are supported. The online
263+
// account button is hidden in all states, including fully set up online accounts where
264+
// status == OnlineAccountStatus.Done
265+
binding.onlineAccountBtn.isVisible = false
265266
binding.onlineAccountBtn.isClickable = !isLinkingInProgress
266267
binding.onlineNavIcon.isVisible = !isLinkingInProgress
267268

wallet/CHANGES

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
11
DashPay Wallet
2+
v11.8.1
3+
Crowdnode
4+
- Restricted CrowdNode to withdrawals only — deposits, account linking, and the online account button are disabled for existing accounts (#1490, and the follow-up fix to hide the online account button, which addresses the v11.8.1 getAccountUrl NPE)
5+
v11.8.0
6+
New features & redesigns
7+
- DashSpend: support for gift card quantities for PiggyCards (#1483)
8+
- Tools menu: redesigned and aligned the tools dialogs (#1479)
9+
- CSV export / ZenLedger: updated designs (#1475)
10+
11+
Maya integration
12+
- Added the full Maya swap integration
13+
14+
Stability & performance fixes
15+
- Eliminated screen-switch crashes (#1477)
16+
- Improved Blockchain Service shutdown and the TxDisplayCache (#1482)
17+
- Optimized home-screen display using a transaction cache (#1473)
18+
- Explore Dash: prevent DB crash by restoring the database if corrupted (#1485)
19+
- Coinbase: prevent crash and show an error when there's no USD account (#1481)
20+
21+
Maintenance
22+
- Translated ScanActivity to Kotlin (#1250)
23+
- translation updates and minor bug fixes (#1488)
24+
225
v11.7.1
326
* Fix issues with instantsend
427

wallet/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ android {
225225
minSdkVersion 24
226226
targetSdkVersion 35
227227
// version code: MMmmppbb; MM = Major Version, mm = minor version, pp == patch version, bb = build
228-
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 11080010
229-
versionName project.hasProperty('versionName') ? project.property('versionName') : "11.8.0"
228+
versionCode project.hasProperty('versionCode') ? project.property('versionCode') as int : 11080101
229+
versionName project.hasProperty('versionName') ? project.property('versionName') : "11.8.1"
230230
multiDexEnabled true
231231
generatedDensities = ['hdpi', 'xhdpi']
232232
vectorDrawables.useSupportLibrary = true

0 commit comments

Comments
 (0)