Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

simplify personal event publishing, fix delete refresh issues #2183

Merged
merged 1 commit into from
Sep 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 2 additions & 17 deletions js/src/api/subscriptions/personal.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export default class Personal {
this._api = api;
this._updateSubscriptions = updateSubscriptions;
this._started = false;

this._lastAccounts = [];
this._lastInfo = {};
}

get isStarted () {
Expand All @@ -43,27 +40,15 @@ export default class Personal {
return this._api.personal
.listAccounts()
.then((accounts) => {
let different = false;

if (accounts.length !== this._lastAccounts.length) {
different = true;
}

if (different) {
this._lastAccounts = accounts;
this._updateSubscriptions('personal_listAccounts', null, accounts);
}
this._updateSubscriptions('personal_listAccounts', null, accounts);
});
}

_accountsInfo = () => {
return this._api.personal
.accountsInfo()
.then((info) => {
if (JSON.stringify(this._lastInfo) !== JSON.stringify(info)) {
this._lastInfo = info;
this._updateSubscriptions('personal_accountsInfo', null, info);
}
this._updateSubscriptions('personal_accountsInfo', null, info);
});
}

Expand Down
2 changes: 1 addition & 1 deletion js/src/modals/AddAddress/addAddress.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class AddAddress extends Component {
icon={ <ContentAdd /> }
label='Save Address'
disabled={ hasError }
onTouchTap={ this.onAdd } />
onClick={ this.onAdd } />
]);
}

Expand Down