Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
refactor(WalletTokenEndpoints): slightly modified result
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Jan 8, 2016
1 parent f149f45 commit c313e2e
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions assets/js/services/wallet.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ function Wallet($http, $window, $timeout, Alerts, MyWallet, MyBlockchainApi, MyB
wallet.applyIfNeeded();
}

const error = (message) => {
console.log(message);
errorCallback(message);
const error = (e) => {
errorCallback(e.error);
wallet.applyIfNeeded();
}

Expand Down Expand Up @@ -1279,45 +1278,45 @@ function Wallet($http, $window, $timeout, Alerts, MyWallet, MyBlockchainApi, MyB
};

wallet.verifyEmail = (token, successCallback, errorCallback) => {
const success = (guid) => {
const success = (res) => {
wallet.user.isEmailVerified = true;
successCallback(guid);
successCallback(res.guid);
wallet.applyIfNeeded();
}

const error = (message) => {
console.log(message);
errorCallback(message);
const error = (res) => {
console.log(res.error);
errorCallback(res.error);
wallet.applyIfNeeded();
}

wallet.tokenEndpoints.verifyEmail(token, success, error);
}

wallet.unsubscribe = (token, successCallback, errorCallback) => {
const success = (guid) => {
successCallback(guid);
const success = (res) => {
successCallback(res.guid);
wallet.applyIfNeeded();
}

const error = (message) => {
console.log(message);
errorCallback(message);
const error = (res) => {
console.log(res.error);
errorCallback(res.error);
wallet.applyIfNeeded();
}

wallet.tokenEndpoints.unsubscribe(token, success, error);
}

wallet.authorizeApprove = (token, successCallback, differentBrowserCallback, differentBrowserApproved, errorCallback) => {
const success = (guid) => {
successCallback(guid);
const success = (res) => {
successCallback(res.guid);
wallet.applyIfNeeded();
}

const error = (message) => {
console.log(message);
errorCallback(message);
const error = (res) => {
console.log(res.error);
errorCallback(res.error);
wallet.applyIfNeeded();
}

Expand Down

0 comments on commit c313e2e

Please sign in to comment.