Skip to content

Commit

Permalink
Merge pull request #5551 from brave/reset-wallet
Browse files Browse the repository at this point in the history
Reset wallet completely on disconnect
  • Loading branch information
NejcZdovc authored May 14, 2020
2 parents 9b74357 + b5233a9 commit c37c4cc
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "bat/ledger/internal/uphold/uphold_authorization.h"
#include "bat/ledger/internal/uphold/uphold_card.h"
#include "bat/ledger/internal/uphold/uphold_util.h"
#include "bat/ledger/internal/wallet/wallet_util.h"
#include "bat/ledger/internal/uphold/uphold_transfer.h"
#include "bat/ledger/internal/uphold/uphold_wallet.h"
#include "bat/ledger/internal/ledger_impl.h"
Expand Down Expand Up @@ -259,14 +260,7 @@ void Uphold::OnDisconectWallet(
return;
}

if (wallet->status == ledger::WalletStatus::VERIFIED) {
wallet->status = ledger::WalletStatus::DISCONNECTED_VERIFIED;
} else if (wallet->status == ledger::WalletStatus::CONNECTED ||
wallet->status == ledger::WalletStatus::NOT_CONNECTED) {
wallet->status = ledger::WalletStatus::DISCONNECTED_NOT_VERIFIED;
}

wallet->token = "";
wallet = braveledger_wallet::ResetWallet(std::move(wallet));

ledger_->ShowNotification(
"wallet_disconnected",
Expand Down

0 comments on commit c37c4cc

Please sign in to comment.