summaryrefslogtreecommitdiffstats
path: root/js/app
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-30 16:12:51 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-30 16:12:51 +0200
commite9a2c6bac0dceeffb86e9fb50802af945555d565 (patch)
tree07d7013d9ff0ccec4461f4f257eae1599f471fa8 /js/app
parent88279961c5e2f2bd0711fc4200d58b93b425199e (diff)
more stuff
Diffstat (limited to 'js/app')
-rw-r--r--js/app/Config.js3
-rw-r--r--js/app/Run.js14
2 files changed, 10 insertions, 7 deletions
diff --git a/js/app/Config.js b/js/app/Config.js
index 772547178..986699090 100644
--- a/js/app/Config.js
+++ b/js/app/Config.js
@@ -99,9 +99,6 @@ app.config(function ($routeProvider, $provide, $httpProvider) {
templateUrl: 'content.html',
resolve: getResolve(feedType.FOLDER),
type: feedType.FOLDER
- })
- .otherwise({
- redirectTo: '/items'
});
});
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();
});