From c0dfbd50778a3d5eb98cae491592c3d3df7d6181 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Sun, 12 Nov 2017 14:53:47 +0100 Subject: [PATCH] Ensure categories are always loaded --- app/routes/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/routes/index.js b/app/routes/index.js index d77473f..d1d5bb0 100644 --- a/app/routes/index.js +++ b/app/routes/index.js @@ -34,6 +34,14 @@ export default Route.extend({ return items; }); + }, + + setupController(controller, model) { + this._super(controller, model); + + if (isEmpty(this.get('storage.categories')) && this.get('storage.connected')) { + this.get('storage').fetchCategories(); + } } });