More connect improvements
* Use extra route for disconnected/initial state * Style connect screen properly * Hide widget when connected in favor of custom UI * Show account info in sidebar header
This commit is contained in:
@@ -11,6 +11,7 @@ export default Service.extend({
|
||||
widget: null,
|
||||
connecting: true,
|
||||
connected: false,
|
||||
userAddress: null,
|
||||
disconnected: computed.not('connected'),
|
||||
client: null,
|
||||
rootListing: null,
|
||||
@@ -43,6 +44,7 @@ export default Service.extend({
|
||||
console.debug('rs.on connected');
|
||||
this.set('connecting', false);
|
||||
this.set('connected', true);
|
||||
this.set('userAddress', this.get('rs').remote.userAddress);
|
||||
});
|
||||
|
||||
rs.on('not-connected', () => {
|
||||
@@ -78,10 +80,17 @@ export default Service.extend({
|
||||
if (this.get('connected')) {
|
||||
this.fetchRootListing();
|
||||
} else {
|
||||
this.set('rootListing', null);
|
||||
this.clearLocalData();
|
||||
}
|
||||
}),
|
||||
|
||||
clearLocalData() {
|
||||
this.setProperties({
|
||||
userAddress: null,
|
||||
rootListing: null
|
||||
});
|
||||
},
|
||||
|
||||
fetchRootListing() {
|
||||
this.fetchListing('').then(items => {
|
||||
this.set('rootListing', items.sortBy('name'));
|
||||
|
||||
Reference in New Issue
Block a user