Skip to content

Commit

Permalink
Fixes wallet create status; Fixes favicon for the panel
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Oct 23, 2018
1 parent aa984dc commit d589cec
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
9 changes: 5 additions & 4 deletions include/bat/ledger/ledger_callback_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ LEDGER_EXPORT enum Result {
CAPTCHA_FAILED = 6,
NO_PUBLISHER_LIST = 7,

TOO_MANY_RESULTS,
NOT_FOUND,
TOO_MANY_RESULTS = 8,
NOT_FOUND = 9,

REGISTRATION_VERIFICATION_FAILED,
BAD_REGISTRATION_RESPONSE,
REGISTRATION_VERIFICATION_FAILED = 10,
BAD_REGISTRATION_RESPONSE = 11,
WALLET_CREATED = 12,
// some more useful result codes should go here
};

Expand Down
2 changes: 1 addition & 1 deletion src/bat_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void BatClient::registerPersonaCallback(bool result,

resetReconcileStamp();

ledger_->OnWalletInitialized(ledger::Result::LEDGER_OK);
ledger_->OnWalletInitialized(ledger::Result::WALLET_CREATED);
}

void BatClient::resetReconcileStamp() {
Expand Down
13 changes: 11 additions & 2 deletions src/bat_publishers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,17 @@ void BatPublishers::getPublisherActivityFromUrl(uint64_t windowId, const ledger:
false,
ledger_->GetReconcileStamp());

ledger_->GetPublisherInfo(filter,
std::bind(&BatPublishers::onPublisherActivity, this, _1, _2, windowId, visit_data));
ledger::VisitData new_data;
new_data.domain = visit_data.domain;
new_data.path = visit_data.path;
new_data.local_month = visit_data.local_month;
new_data.local_year = visit_data.local_year;
new_data.name = visit_data.name;
new_data.url = visit_data.url;
new_data.favicon_url = "";

ledger_->GetPublisherInfo(filter,
std::bind(&BatPublishers::onPublisherActivity, this, _1, _2, windowId, new_data));
}

void BatPublishers::onPublisherActivity(ledger::Result result,
Expand Down
2 changes: 1 addition & 1 deletion src/ledger_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void LedgerImpl::OnWalletInitialized(ledger::Result result) {
initializing_ = false;
ledger_client_->OnWalletInitialized(result);

if (result == ledger::Result::LEDGER_OK) {
if (result == ledger::Result::LEDGER_OK || result == ledger::Result::WALLET_CREATED) {
initialized_ = true;
LoadPublisherList(this);
Reconcile();
Expand Down

0 comments on commit d589cec

Please sign in to comment.