fix: lint-error
This commit is contained in:
@@ -18,8 +18,7 @@
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-icon v-on="on" v-on:click="fetchAddress()"
|
||||
>mdi-crosshairs-gps
|
||||
</v-icon
|
||||
>
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-text="$t('origins.fetchAddress')" />
|
||||
</v-tooltip>
|
||||
@@ -30,8 +29,7 @@
|
||||
:disabled="!origin"
|
||||
v-on:click="saveOrigin(origin)"
|
||||
>mdi-bookmark-plus-outline
|
||||
</v-icon
|
||||
>
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-text="$t('origins.save')" />
|
||||
</v-tooltip>
|
||||
@@ -82,10 +80,10 @@
|
||||
<script>
|
||||
import { useMutations, useRouter } from '@u3u/vue-hooks'
|
||||
import { computed, ref, watch } from '@vue/composition-api'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import { useAuth } from '../../../plugins/auth'
|
||||
|
||||
import List from './List'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import {
|
||||
fetchAddress,
|
||||
findEvents,
|
||||
@@ -113,7 +111,11 @@
|
||||
set: value => router.push(`/?range=${value}`)
|
||||
})
|
||||
const enabled = ref(false)
|
||||
const { result: data, refetch } = useQuery(findEvents, { includeOrigins: false }, () => ({ enabled: enabled.value }))
|
||||
const { result: data, refetch } = useQuery(
|
||||
findEvents,
|
||||
{ includeOrigins: false },
|
||||
() => ({ enabled: enabled.value })
|
||||
)
|
||||
const events = useResult(data, [], result => result.events)
|
||||
const origins = useResult(data, [], result => result.origins)
|
||||
watch(
|
||||
@@ -153,9 +155,13 @@
|
||||
}
|
||||
|
||||
const { mutate: doToggleIgnoreBand } = useMutation(toggleIgnoreBand)
|
||||
const { mutate: doToggleIgnoreDanceHall } = useMutation(toggleIgnoreDanceHall)
|
||||
const { mutate: doToggleIgnoreDanceHall } = useMutation(
|
||||
toggleIgnoreDanceHall
|
||||
)
|
||||
const { mutate: doToggleIgnoreCity } = useMutation(toggleIgnoreCity)
|
||||
const { mutate: doToggleIgnoreMunicipality } = useMutation(toggleIgnoreMunicipality)
|
||||
const { mutate: doToggleIgnoreMunicipality } = useMutation(
|
||||
toggleIgnoreMunicipality
|
||||
)
|
||||
const { mutate: doToggleIgnoreState } = useMutation(toggleIgnoreState)
|
||||
|
||||
const toggleIgnoreSuccess = name => {
|
||||
@@ -208,7 +214,11 @@
|
||||
|
||||
const { mutate: doSaveOrigin } = useMutation(saveOrigin)
|
||||
const addressEnabled = ref(false)
|
||||
const { result: address, refetch: doFetchAddress } = useQuery(fetchAddress, {}, () => ({ enabled: addressEnabled.value }))
|
||||
const { result: address, refetch: doFetchAddress } = useQuery(
|
||||
fetchAddress,
|
||||
{},
|
||||
() => ({ enabled: addressEnabled.value })
|
||||
)
|
||||
const fetchAddressFn = () => {
|
||||
if (window.navigator) {
|
||||
window.navigator.geolocation.getCurrentPosition(pos => {
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
<script>
|
||||
import { ref } from '@vue/composition-api'
|
||||
import { useMutations } from '@u3u/vue-hooks'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import {
|
||||
fetchFilters,
|
||||
toggleIgnoreBand,
|
||||
@@ -69,7 +70,6 @@ import {
|
||||
} from '~/utils/graph-client'
|
||||
|
||||
import List from './List'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import { useAuth } from '../../../plugins/auth'
|
||||
import { useTranslation } from '../../../plugins/i18n'
|
||||
|
||||
@@ -90,9 +90,13 @@ export default {
|
||||
const states = useResult(data, [], result => result.states)
|
||||
const snackbar = ref({ active: false, color: 'success', text: '' })
|
||||
const { mutate: doToggleIgnoreBand } = useMutation(toggleIgnoreBand)
|
||||
const {mutate: doToggleIgnoreDanceHall} = useMutation(toggleIgnoreDanceHall)
|
||||
const { mutate: doToggleIgnoreDanceHall } = useMutation(
|
||||
toggleIgnoreDanceHall
|
||||
)
|
||||
const { mutate: doToggleIgnoreCity } = useMutation(toggleIgnoreCity)
|
||||
const {mutate: doToggleIgnoreMunicipality} = useMutation(toggleIgnoreMunicipality)
|
||||
const { mutate: doToggleIgnoreMunicipality } = useMutation(
|
||||
toggleIgnoreMunicipality
|
||||
)
|
||||
const { mutate: doToggleIgnoreState } = useMutation(toggleIgnoreState)
|
||||
|
||||
const toggleIgnoreSuccess = name => {
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-icon v-on="on" v-on:click="fetchAddress()"
|
||||
>mdi-crosshairs-gps
|
||||
</v-icon
|
||||
>
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-text="$t('origins.fetchAddress')" />
|
||||
</v-tooltip>
|
||||
@@ -24,8 +23,7 @@
|
||||
:disabled="!origin"
|
||||
v-on:click="saveOrigin(origin)"
|
||||
>mdi-bookmark-plus-outline
|
||||
</v-icon
|
||||
>
|
||||
</v-icon>
|
||||
</template>
|
||||
<span v-text="$t('origins.save')" />
|
||||
</v-tooltip>
|
||||
@@ -61,8 +59,13 @@
|
||||
<script>
|
||||
import { ref } from '@vue/composition-api'
|
||||
import { useMutations } from '@u3u/vue-hooks'
|
||||
import { fetchAddress, findOrigins, removeOrigin, saveOrigin } from '../../../utils/graph-client'
|
||||
import { useMutation, useQuery, useResult } from '@vue/apollo-composable'
|
||||
import {
|
||||
fetchAddress,
|
||||
findOrigins,
|
||||
removeOrigin,
|
||||
saveOrigin
|
||||
} from '../../../utils/graph-client'
|
||||
import { useAuth } from '../../../plugins/auth'
|
||||
import { useTranslation } from '../../../plugins/i18n'
|
||||
|
||||
@@ -78,14 +81,17 @@
|
||||
const { mutate: doSaveOrigin } = useMutation(saveOrigin)
|
||||
const { mutate: doRemoveOrigin } = useMutation(removeOrigin)
|
||||
const enabled = ref(false)
|
||||
const { refetch: doFetchAddress } = useQuery(fetchAddress, {}, () => ({ enabled: enabled.value }))
|
||||
const { refetch: doFetchAddress } = useQuery(fetchAddress, {}, () => ({
|
||||
enabled: enabled.value
|
||||
}))
|
||||
const origin = ref('')
|
||||
const fetchAddressFn = () => {
|
||||
if (window.navigator) {
|
||||
window.navigator.geolocation.getCurrentPosition(pos => {
|
||||
enabled.value = true
|
||||
doFetchAddress({ latlng: `${pos.coords.latitude},${pos.coords.longitude}` })
|
||||
.then(res => {
|
||||
doFetchAddress({
|
||||
latlng: `${pos.coords.latitude},${pos.coords.longitude}`
|
||||
}).then(res => {
|
||||
origin.value = res.address
|
||||
})
|
||||
})
|
||||
|
||||
+1
-3
@@ -18,9 +18,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
buildModules: [
|
||||
'nuxt-composition-api'
|
||||
],
|
||||
buildModules: ['nuxt-composition-api'],
|
||||
css: ['vuetify/dist/vuetify.css', '~/assets/scss/global.scss'],
|
||||
env: {
|
||||
graphqlApi: process.env.GRAPHQL_API
|
||||
|
||||
+7
-4
@@ -1,13 +1,16 @@
|
||||
import { ApolloClient } from 'apollo-client'
|
||||
import { InMemoryCache, IntrospectionFragmentMatcher } from 'apollo-cache-inmemory'
|
||||
import {
|
||||
InMemoryCache,
|
||||
IntrospectionFragmentMatcher
|
||||
} from 'apollo-cache-inmemory'
|
||||
import { createHttpLink } from 'apollo-link-http'
|
||||
import { setContext } from 'apollo-link-context'
|
||||
import { useAuth } from './auth'
|
||||
import { provide } from '@vue/composition-api'
|
||||
import introspectionQueryResultData from '../fragmentTypes.json'
|
||||
import { onGlobalSetup } from 'nuxt-composition-api'
|
||||
import { DefaultApolloClient } from '@vue/apollo-composable'
|
||||
import Vue from 'vue'
|
||||
import introspectionQueryResultData from '../fragmentTypes.json'
|
||||
import { useAuth } from './auth'
|
||||
|
||||
const apiUrl = process.env.graphqlApi || '/query'
|
||||
|
||||
@@ -21,7 +24,7 @@ const httpLink = createHttpLink({
|
||||
uri: apiUrl
|
||||
})
|
||||
|
||||
const getToken = async (options) => {
|
||||
const getToken = async options => {
|
||||
const { getTokenSilently } = useAuth()
|
||||
return getTokenSilently.value(options)
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,6 +10,7 @@ let instance
|
||||
const params = new URL(window.location).searchParams
|
||||
const domain = params.get('domain') || 'unbound.eu.auth0.com'
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
if (instance) {
|
||||
return toRefs(instance)
|
||||
@@ -105,14 +106,12 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
instance.auth0Client = createAuth0Client(options)
|
||||
instance.auth0Client.then(client => {
|
||||
instance.loading = true
|
||||
// instance.auth0Client = client
|
||||
try {
|
||||
// If the user is returning to the app after authentication..
|
||||
if (
|
||||
window.location.search.includes('code=') &&
|
||||
window.location.search.includes('state=')
|
||||
) {
|
||||
console.log('location search', window.location.search)
|
||||
// handle the redirect and retrieve tokens
|
||||
client
|
||||
.handleRedirectCallback()
|
||||
@@ -123,6 +122,7 @@ export const useAuth = (onRedirectCallback = DEFAULT_REDIRECT_CALLBACK) => {
|
||||
// Initialize our internal authentication state
|
||||
fetchUser()
|
||||
})
|
||||
// eslint-disable-next-line no-console
|
||||
.catch(e => console.error('error handling redirect callback', e))
|
||||
} else {
|
||||
fetchUser()
|
||||
|
||||
Reference in New Issue
Block a user