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:
2017-12-25 10:50:03 +01:00
parent 07be7dece8
commit 5d533d2c08
14 changed files with 354 additions and 25 deletions

View File

@@ -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'));