Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
chore(Release): bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore3 committed Sep 26, 2016
1 parent 610b6c9 commit ec9928f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blockchain-wallet-client",
"version": "3.22.18",
"version": "3.22.19",
"description": "Blockchain.info JavaScript Wallet",
"homepage": "https://github.com/blockchain/my-wallet-v3",
"bugs": {
Expand Down
21 changes: 14 additions & 7 deletions src/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,22 +555,29 @@ MyWallet.recoverFromMnemonic = function (inputedEmail, inputedPassword, mnemonic
};

// used frontend and mywallet
MyWallet.logout = function (sessionToken, force) {
MyWallet.logout = function (force, beforeLogout) {
beforeLogout = beforeLogout || function () {};

if (!force && WalletStore.isLogoutDisabled()) {
return;
return Promise.reject('LOGOUT_PREVENTED');
}

var reload = function () {
try { window.location.reload(); } catch (e) {
try {
window.location.reload();
} catch (e) {
console.log(e);
}
};
var data = { format: 'plain' };
WalletStore.sendEvent('logging_out');

var headers = {sessionToken: sessionToken};
WalletStore.sendEvent('logging_out');
return Promise.resolve(beforeLogout()).then(reload);
};

API.request('GET', 'wallet/logout', data, headers).then(reload).catch(reload);
MyWallet.endSession = function (sessionToken) {
var data = { format: 'plain' };
var headers = { sessionToken: sessionToken };
return API.request('GET', 'wallet/logout', data, headers);
};

// In case of a non-mainstream browser, ensure it correctly implements the
Expand Down

0 comments on commit ec9928f

Please sign in to comment.