diff options
| author | lambda <pleromagit@rogerbraun.net> | 2018-04-29 14:51:15 +0000 |
|---|---|---|
| committer | lambda <pleromagit@rogerbraun.net> | 2018-04-29 14:51:15 +0000 |
| commit | 805410b9336829e8a079b2c3978199f6362a8cab (patch) | |
| tree | d9a98a24d7783f9d27c42c06bd91b2ab15842cd0 | |
| parent | 462eeb90b945711b995726d908d001a6d21735e7 (diff) | |
| parent | 150b815407c9577d153d309c0362d72725e82c6b (diff) | |
Merge branch 'feature/redirect-root-by-login-or-not' into 'develop'
Redirect root by login ro not login
See merge request pleroma/pleroma-fe!251
| -rw-r--r-- | src/main.js | 8 | ||||
| -rw-r--r-- | static/config.json | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main.js b/src/main.js index 6f8c00f0..7ca34adf 100644 --- a/src/main.js +++ b/src/main.js @@ -98,7 +98,13 @@ window.fetch('/static/config.json') } const routes = [ - { name: 'root', path: '/', redirect: data['defaultPath'] || '/main/all' }, + { name: 'root', + path: '/', + redirect: to => { + var redirectRootLogin = data['redirectRootLogin'] + var redirectRootNoLogin = data['redirectRootNoLogin'] + return (store.state.users.currentUser ? redirectRootLogin : redirectRootNoLogin) || '/main/all' + }}, { path: '/main/all', component: PublicAndExternalTimeline }, { path: '/main/public', component: PublicTimeline }, { path: '/main/friends', component: FriendsTimeline }, diff --git a/static/config.json b/static/config.json index 9863ec02..5cf4cdec 100644 --- a/static/config.json +++ b/static/config.json @@ -2,7 +2,8 @@ "theme": "pleroma-dark", "background": "/static/aurora_borealis.jpg", "logo": "/static/logo.png", - "defaultPath": "/main/all", + "redirectRootNoLogin": "/main/all", + "redirectRootLogin": "/main/friends", "chatDisabled": false, "showInstanceSpecificPanel": false } |
