Commit b0dff66b authored by Axel Dürkop's avatar Axel Dürkop
Browse files

Fix showing login state

parent e7b72ebc
......@@ -2,7 +2,7 @@
<nav class="navbar navbar-expand-md navbar-dark bg-primary">
<div class="container">
<router-link class="navbar-brand" :to="$i18nRoute({ name: 'home' })">
<i class="fa fa-users"></i>
<i v-bind:class="{ hypothesis_logged_in: check_hypothesis_access}" class="fa fa-users"></i>
&nbsp;
<b>Zocurelia</b>
<span class="subline">Zotero Curated Reading Lists Annotated</span>
......@@ -18,15 +18,25 @@
<div class="collapse navbar-collapse" id="navbar16">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<router-link class="nav-link" :to="$i18nRoute({ name: 'help' })">{{ $t('navigation.help') }}</router-link>
<router-link
class="nav-link"
:to="$i18nRoute({ name: 'help' })"
>{{ $t('navigation.help') }}</router-link>
</li>
<li class="nav-item">
<router-link class="nav-link" :to="$i18nRoute({ name: 'about' })">{{ $t('navigation.about') }}</router-link>
<router-link
class="nav-link"
:to="$i18nRoute({ name: 'about' })"
>{{ $t('navigation.about') }}</router-link>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<router-link class="nav-link" :to="$i18nRoute({ name: 'settings' })" replace>{{ $t('navigation.settings') }}</router-link>
<router-link
class="nav-link"
:to="$i18nRoute({ name: 'settings' })"
replace
>{{ $t('navigation.settings') }}</router-link>
</li>
<li class="nav-item">
<router-link
......@@ -35,9 +45,6 @@
replace
>{{ $t('navigation.new') }}</router-link>
</li>
<li class="nav-item">
<ShowHypothesisAccess />
</li>
<li class="nav-item">
<LangSwitcher />
</li>
......@@ -48,21 +55,26 @@
</template>
<script>
import ShowHypothesisAccess from "@/components/ShowHypothesisAccess";
import LangSwitcher from "@/components/LangSwitcher";
import { mapActions, mapGetters } from "vuex";
export default {
name: "Navigation",
data() {
return {
};
},
components: {
ShowHypothesisAccess,
LangSwitcher
},
methods: {
...mapActions(["create"])
},
computed: {
...mapGetters(["get_init"])
...mapGetters(["get_init", "hypothesis_access"]),
check_hypothesis_access() {
return this.hypothesis_access;
}
}
};
</script>
......@@ -42,7 +42,8 @@ export default {
return state.search_done;
},
hypothesis_token: state => {
return state.hypothesis_token;
window.console.log(state)
return localStorage.hypothesis_token;
},
hypothesis_group: state => {
return state.hypothesis_group;
......
......@@ -21,7 +21,7 @@ const state = {
},
error: "",
hypothesis_group: "",
hypothesis_access: false
hypothesis_access: localStorage.hypothesis_token != undefined ? true : false
};
export default {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment