diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 16:12:51 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-05-30 16:12:51 +0200 |
commit | e9a2c6bac0dceeffb86e9fb50802af945555d565 (patch) | |
tree | 07d7013d9ff0ccec4461f4f257eae1599f471fa8 /js/app/Run.js | |
parent | 88279961c5e2f2bd0711fc4200d58b93b425199e (diff) |
more stuff
Diffstat (limited to 'js/app/Run.js')
-rw-r--r-- | js/app/Run.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/js/app/Run.js b/js/app/Run.js index c103a6e77..e119f0464 100644 --- a/js/app/Run.js +++ b/js/app/Run.js @@ -31,17 +31,18 @@ app.run(($rootScope, $location, $http, $q, $interval, Loading, ItemResource, }); let activeFeedDeferred = $q.defer(); + let path = $location.path(); $http.get(`${BASE_URL}/feeds/active`).success((data) => { let url; - switch (data.type) { + switch (data.activeFeed.type) { case FEED_TYPE.FEED: - url = '/items/feeds/${data.id}'; + url = `/items/feeds/${data.activeFeed.id}`; break; case FEED_TYPE.FOLDER: - url = '/items/folders/${data.id}'; + url = `/items/folders/${data.activeFeed.id}`; break; case FEED_TYPE.STARRED: @@ -52,7 +53,12 @@ app.run(($rootScope, $location, $http, $q, $interval, Loading, ItemResource, url = '/items'; } - $location.path(url); + // only redirect if url is empty or faulty + // TODO check for faulty url + if (path === '') { + $location.path(url); + } + activeFeedDeferred.resolve(); }); |