Skip to content

Commit

Permalink
Redirect to proposal spaceId if it doesn't match the route key (snaps…
Browse files Browse the repository at this point in the history
…hot-labs#579)

* Redirect to proposal spaceId if it doesn't match the route key

* Remove space
  • Loading branch information
samuveth authored Aug 26, 2021
1 parent 92a5780 commit 4ad9981
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/views/Proposal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ function clickVote() {
async function loadProposal() {
const proposalObj = await getProposal(id);
proposal.value = proposalObj.proposal;
// Redirect to proposal spaceId if it doesn't match route key
if (route.key !== proposal.value.space.id)
router.push({
name: 'proposal',
params: {
key: proposal.value.space.id,
id: proposal.value.id
}
});
loaded.value = true;
const resultsObj = await getResults(
space.value,
Expand Down

0 comments on commit 4ad9981

Please sign in to comment.