File tree Expand file tree Collapse file tree 4 files changed +23
-10
lines changed Expand file tree Collapse file tree 4 files changed +23
-10
lines changed Original file line number Diff line number Diff line change 2
2
<div align =" center" >
3
3
<div class =" InfoContainer" >
4
4
<info-component
5
- v-if =" status === Status.VOTING"
6
5
class =" ELement Info"
7
- :current-card =" currentCard "
6
+ :current-card =" card "
8
7
/>
9
8
<div
10
- v-if =" status === Status.VOTING"
11
9
class =" ELement"
12
10
>
13
11
<CardComponent
16
14
/>
17
15
</div >
18
16
<div
19
- v-if =" status === Status.NOVOTESLEFT"
20
17
class =" ELement"
21
18
>
22
19
<img
35
32
<script >
36
33
import CardComponent from " @/components/elements/CardComponent" ;
37
34
import InfoComponent from " @/components/elements/VotingComponents/InfoComponent.vue" ;
35
+ import { Council } from " @/model/Council" ;
36
+ import { Card } from " @/model/Card" ;
38
37
39
38
export default {
40
39
name: " CouncilComponent" ,
@@ -49,8 +48,8 @@ export default {
49
48
},
50
49
data () {
51
50
return {
52
- council: {} ,
53
- card: {} ,
51
+ council: new Council () ,
52
+ card: new Card () ,
54
53
};
55
54
},
56
55
watch: {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { GenericAuthorization } from "../store/generated/cosmos/cosmos-sdk/cosmo
9
9
import { Card , ChainCard } from "@/model/Card" ;
10
10
import { User } from "@/model/User" ;
11
11
import { Coin } from "@/model/Coin" ;
12
+ import { Council } from "@/model/Council" ;
12
13
//import {Any} from "../store/generated/cosmos/cosmos-sdk/cosmos.authz.v1beta1/module/types/google/protobuf/any.js"
13
14
14
15
export default {
@@ -325,7 +326,7 @@ export default {
325
326
this . vue . notifyFail ( 'WTF' , 'A council was looked up that does not exist in the blockchain.' )
326
327
throw new Error ( 'Council with ' + id + ' does not exist.' )
327
328
} else {
328
- return res . data
329
+ return Council . from ( res . data )
329
330
}
330
331
} )
331
332
handleGetCardList = R . curry ( ( res , type ) => {
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ const routes = [
79
79
component : ImprintPage
80
80
} ,
81
81
{
82
- path : '/vote' ,
82
+ path : '/vote/:mode? ' ,
83
83
name : 'Vote' ,
84
84
component : VotingPage
85
85
} ,
Original file line number Diff line number Diff line change 11
11
<button
12
12
class =" ModeButton"
13
13
:style =" `font-weight: ${ getThiccness(Mode.ENCOUNTER) }`"
14
- @click =" mode = Mode.ENCOUNTER"
14
+ @click =" setMode( Mode.ENCOUNTER) "
15
15
>
16
16
<a >Encounters</a >
17
17
</button >
18
18
<button
19
19
class =" ModeButton"
20
20
:style =" `font-weight: ${ getThiccness(Mode.COUNCIL) }`"
21
- @click =" mode = Mode.COUNCIL"
21
+ @click =" setMode( Mode.COUNCIL) "
22
22
>
23
23
<a >Council</a >
24
24
</button >
@@ -50,7 +50,20 @@ export default {
50
50
Mode: Mode,
51
51
}
52
52
},
53
+ mounted () {
54
+ let mode = this .$route .params .mode
55
+ console .log (" yees" , mode)
56
+ if (mode) {
57
+ this .mode = parseInt (String (mode))
58
+ } else {
59
+ this .setMode (this .mode )
60
+ }
61
+ },
53
62
methods: {
63
+ setMode (mode ) {
64
+ this .mode = mode
65
+ this .$router .push ({name: " Vote" , params: {mode: this .mode }})
66
+ },
54
67
getThiccness (mode ) {
55
68
if (mode === this .mode ) {
56
69
return " bold"
You can’t perform that action at this time.
0 commit comments