Improve connection handling

* Clear directory data on disconnect
* Clear path URL param on disconnect
* Don't try to fetch dir listing when starting app disconnected
This commit is contained in:
2017-12-22 12:52:48 +01:00
parent b49cb5c50e
commit e865ffe073
4 changed files with 25 additions and 7 deletions

View File

@@ -14,6 +14,8 @@ export default Route.extend({
},
model(params) {
if (this.get('storage.disconnected')) { return {}; }
let path = params.path;
if (isEmpty(params.path)) { return null; }
@@ -28,6 +30,7 @@ export default Route.extend({
setupController(controller, model) {
this._super(controller, model);
if (this.get('storage.disconnected')) { return true; }
if (isEmpty(this.get('storage.categories')) && this.get('storage.connected')) {
this.get('storage').fetchRootListing();