Skip to content

Commit

Permalink
🐛 Allow non-CLer to visit /civic/dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt committed Jul 13, 2021
1 parent ac59a9c commit b582e8b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/pages/civic/dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
preset="primary-outline"
/>
</header>
<CivicDashboard v-if="getUserIsCivicLikerV2" />
<CivicDashboard v-if="shouldShowNewDashboard" />
<CivicSettingsV1 v-else />
</div>
</div>
Expand All @@ -30,8 +30,6 @@
<script>
import { mapGetters } from 'vuex';
import { DEFAULT_CL_SUPPORTER } from '~/constant';
import Button from '~/components/Button/Button';
import CivicSettingsV1 from '~/components/CivicSettingsV1';
import CivicDashboard from '~/components/CivicDashboard';
Expand All @@ -48,13 +46,10 @@ export default {
SiteNavBar,
},
computed: {
...mapGetters(['getUserIsCivicLikerV2']),
},
fetch({ store, redirect }) {
const { getUserIsCivicLiker, getUserShouldRenewCivic } = store.getters;
if (!getUserIsCivicLiker && !getUserShouldRenewCivic) {
redirect({ name: 'id-civic', params: { id: DEFAULT_CL_SUPPORTER } });
}
...mapGetters(['getUserIsCivicLikerV2', 'getUserIsCivicLiker']),
shouldShowNewDashboard() {
return !!(this.getUserIsCivicLikerV2 || !this.getUserIsCivicLiker);
},
},
};
</script>

0 comments on commit b582e8b

Please sign in to comment.