diff --git a/wallet/res/layout/block_username_request_view.xml b/wallet/res/layout/block_username_request_view.xml index 4e779adc71..0a2655b3d6 100644 --- a/wallet/res/layout/block_username_request_view.xml +++ b/wallet/res/layout/block_username_request_view.xml @@ -1,5 +1,5 @@ - - - - - - - - - - + - diff --git a/wallet/res/layout/username_request_view.xml b/wallet/res/layout/username_request_view.xml index 47d541cb9f..329373ed3a 100644 --- a/wallet/res/layout/username_request_view.xml +++ b/wallet/res/layout/username_request_view.xml @@ -25,16 +25,6 @@ android:background="?attr/selectableItemBackground" tools:context="de.schildbach.wallet.ui.username.adapters.UsernameRequestViewHolder"> - - - - - - - - - - , votesAmount: Int) - @Query("SELECT * FROM imported_masternode_keys") suspend fun getAll(): List diff --git a/wallet/src/de/schildbach/wallet/database/dao/UsernameVoteDao.kt b/wallet/src/de/schildbach/wallet/database/dao/UsernameVoteDao.kt index 2357ea4662..8b0322f3ce 100644 --- a/wallet/src/de/schildbach/wallet/database/dao/UsernameVoteDao.kt +++ b/wallet/src/de/schildbach/wallet/database/dao/UsernameVoteDao.kt @@ -1,5 +1,5 @@ /* - * Copyright 2023 Dash Core Group. + * Copyright 2024 Dash Core Group. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,12 +26,6 @@ interface UsernameVoteDao { @Insert(onConflict = OnConflictStrategy.REPLACE) suspend fun insert(usernameVote: UsernameVote) - @Update - suspend fun update(usernameVote: UsernameVote) - -// @Query("UPDATE username_votes SET votes = votes + :votesAmount, isApproved = 1 WHERE requestId IN (:requestIds)") -// suspend fun voteForRequest(requestIds: List, votesAmount: Int) - @Query("SELECT * FROM username_votes WHERE username = :username") suspend fun getVotes(username: String): List diff --git a/wallet/src/de/schildbach/wallet/service/platform/PlatformSyncService.kt b/wallet/src/de/schildbach/wallet/service/platform/PlatformSyncService.kt index f868aa0d65..d93e585c54 100644 --- a/wallet/src/de/schildbach/wallet/service/platform/PlatformSyncService.kt +++ b/wallet/src/de/schildbach/wallet/service/platform/PlatformSyncService.kt @@ -1080,11 +1080,9 @@ class PlatformSynchronizationService @Inject constructor( usernameRequestDao.insert(usernameRequest) } else { // voting is complete - //if (name != blockchainIdentityDataDao.loadBase().username) { - usernameRequestDao.remove( - UsernameRequest.getRequestId(identifier.toString(), name) - ) - //} + usernameRequestDao.remove( + UsernameRequest.getRequestId(identifier.toString(), name) + ) } } } catch(e: Exception) { diff --git a/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsFragment.kt b/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsFragment.kt index 3cc44bfe0d..d4add8e086 100644 --- a/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsFragment.kt +++ b/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsFragment.kt @@ -53,9 +53,10 @@ class UsernameRequestsFragment : Fragment(R.layout.fragment_username_requests) { super.onViewCreated(view, savedInstanceState) val binding = this.binding - binding.toolbar.setOnClickListener { - viewModel.prepopulateList() - } + // TODO: remove when development is complete +// binding.toolbar.setOnClickListener { +// viewModel.prepopulateList() +// } binding.toolbar.setNavigationOnClickListener { findNavController().popBackStack() } binding.filterBtn.setOnClickListener { diff --git a/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsViewModel.kt b/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsViewModel.kt index a5c3c68610..557e6f8f70 100644 --- a/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsViewModel.kt +++ b/wallet/src/de/schildbach/wallet/ui/username/UsernameRequestsViewModel.kt @@ -121,30 +121,11 @@ class UsernameRequestsViewModel @Inject constructor( private val masternodeListManager: SimplifiedMasternodeListManager get() = walletDataProvider.wallet!!.context.masternodeListManager - // TODO: remove this private val _addedKeys = MutableStateFlow(listOf()) -// val masternodes: Flow> = _addedKeys.map { -// val masternodesForKeys = arrayListOf() -// it.forEach { key -> -// val entries = masternodeListManager.listAtChainTip.getMasternodesByVotingKey(KeyId.fromBytes(key.pubKeyHash)) -// masternodesForKeys.addAll(entries) -// } -// masternodesForKeys -// } - private val _masternodes = MutableStateFlow>(listOf()) - val masternodes: StateFlow>// = importedMasternodeKeyDao.observeAll() + val masternodes: StateFlow> get() = _masternodes -// .onEach { -// val masternodesForKeys = arrayListOf() -// it.forEach { key -> -// val entries = masternodeListManager.listAtChainTip.getMasternodesByVotingKey(KeyId.fromBytes(key.pubKeyHash)) -// masternodesForKeys.addAll(entries) -// } -// masternodesForKeys -// } -// .launchIn(viewModelScope) -// } + private val currentImportedKeys = listOf() private val currentMasternodeKeyUsage = listOf() @@ -185,8 +166,6 @@ class UsernameRequestsViewModel @Inject constructor( val allKeys = arrayListOf() allKeys.addAll(importedKeyList) - //val authenticationGroupExtension = walletDataProvider.wallet!!.getKeyChainExtension(AuthenticationGroupExtension.EXTENSION_ID) as AuthenticationGroupExtension - usage.forEach { if ((it.type == AuthenticationKeyChain.KeyChainType.MASTERNODE_VOTING || it.type == AuthenticationKeyChain.KeyChainType.MASTERNODE_OWNER) && @@ -396,6 +375,7 @@ class UsernameRequestsViewModel @Inject constructor( } private var nameCount = 1 + // TODO: remove this when development is completed. fun prepopulateList() { nameCount++ val now = System.currentTimeMillis()// / 1000