Skip to content

Commit

Permalink
quieten some debugging
Browse files Browse the repository at this point in the history
fix plausible config
  • Loading branch information
Derek Colley committed Apr 28, 2023
1 parent a8e0ee6 commit f7e1712
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
10 changes: 5 additions & 5 deletions ui3/src/components/CandidateReferenda.vue
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default defineComponent({
]
const collectTrackVotes = (accountId: string, refId: number, trackId: number, vote: any) => {
console.debug('collectTrackVotes', accountId, refId, trackId, vote)
// console.debug('collectTrackVotes', accountId, refId, trackId, vote)
const ref = refVoting.value.find((f: any) => f.refId === refId)
if (ref) {
ref.voteStack.push([accountId, vote])
Expand All @@ -290,7 +290,7 @@ export default defineComponent({
const vote2: any = vote?.toJSON()
// console.log('vote2', trackId, vote2)
if (vote2.casting) {
console.debug('--> casting', vote2.casting)
// console.debug('--> casting', vote2.casting)
// vote2.casting.votes?.forEach(([refId, vote]: any) => {
for (let j = 0; j < vote2.casting.votes?.length; j++) {
const [refId, vote] = vote2.casting.votes[j]
Expand Down Expand Up @@ -332,7 +332,7 @@ export default defineComponent({
// vote = vote.toJSON()
await getTrackVotes(candidate.value.stash, track.id, [])
}
console.debug('refVoting', refVoting.value)
// console.debug('refVoting', refVoting.value)
// refVoting.value = refVoting2
// this.trackVoting = trackVoting
// return Promise.resolve(refVoting2)
Expand All @@ -346,11 +346,11 @@ export default defineComponent({
const hasVotedInRef = (item: any) => {
// const iitem = {...item}
console.debug('hasVotedInRef', {...item})
// console.debug('hasVotedInRef', {...item})
// const [refId, _] = iitem
if (item.id) {
const refVote = refVoting.value.find(f => f.refId === item.id)
console.debug('=>', refVote)
// console.debug('=>', refVote)
const hasVote = refVote?.voteStack.find(([_, vote]: any) => vote.standard)
return hasVote ? true : false
} else {
Expand Down
2 changes: 1 addition & 1 deletion ui3/src/components/CandidateReferendaVote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default defineComponent({
const refId = tmpReferenda.id || ''
// console.debug('refId', refId)
refVote.value = refVoting.value.find((f: any) => f.refId === refId) as Record<any, any>
console.log('refVote', refVote.value)
// console.log('refVote', refVote.value)
})
return {
Expand Down
6 changes: 4 additions & 2 deletions ui3/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
// Plugins
import { loadFonts } from './webfontloader'
import vuetify from './vuetify'
import router from '../router'
import store from '../store'
import router from '../router'
import { SubstratePlugin } from './substrate'
import { PlausiblePlugin } from './plausible'
import plausibleModule from '@/store/modules/plausible'
import { apolloProvider } from './apollo'
import { DefaultApolloClient } from '@vue/apollo-composable'

Expand All @@ -27,5 +28,6 @@ export function registerPlugins (app: App) {
// .provide('$substrate', substrate)
.use(apolloProvider)
.provide(DefaultApolloClient, apolloProvider.defaultClient)
.use(PlausiblePlugin, store.getters['plausible/options'])
// .use(PlausiblePlugin, store.getters['plausible/options'])
.use(PlausiblePlugin, plausibleModule.state.options)
}
5 changes: 3 additions & 2 deletions ui3/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ const router = createRouter({
}
})

// TODO move this to a plugin?
const plausible = Plausible(store.getters['plausible/options'])
// // TODO move this to a plugin?
import plausibleModule from '../store/modules/plausible'
const plausible = Plausible(plausibleModule.state.options)
plausible.enableAutoPageviews();

router.beforeEach((to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext) => {
Expand Down

0 comments on commit f7e1712

Please sign in to comment.