Fix some glitchtip errors
This commit is contained in:
parent
2f2409f9f2
commit
e6bc1ab655
|
@ -2,7 +2,7 @@
|
||||||
import type { BackendError } from '~/types'
|
import type { BackendError } from '~/types'
|
||||||
import type { RouteLocationRaw } from 'vue-router'
|
import type { RouteLocationRaw } from 'vue-router'
|
||||||
|
|
||||||
import { ref, reactive, computed, onMounted } from 'vue'
|
import { ref, reactive, computed, onMounted, nextTick } from 'vue'
|
||||||
import { useGettext } from 'vue3-gettext'
|
import { useGettext } from 'vue3-gettext'
|
||||||
import { useStore } from '~/store'
|
import { useStore } from '~/store'
|
||||||
|
|
||||||
|
@ -34,7 +34,10 @@ const labels = computed(() => ({
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const username = ref()
|
const username = ref()
|
||||||
onMounted(() => username.value.focus())
|
onMounted(async () => {
|
||||||
|
await nextTick()
|
||||||
|
username.value?.focus()
|
||||||
|
})
|
||||||
|
|
||||||
const isLoading = ref(false)
|
const isLoading = ref(false)
|
||||||
const errors = ref([] as string[])
|
const errors = ref([] as string[])
|
||||||
|
|
|
@ -38,9 +38,9 @@ export default (props: PlayOptionsProps) => {
|
||||||
return props.track.uploads?.length > 0
|
return props.track.uploads?.length > 0
|
||||||
} else if (props.artist) {
|
} else if (props.artist) {
|
||||||
return props.artist.tracks_count > 0
|
return props.artist.tracks_count > 0
|
||||||
|| props.artist?.albums.some((album) => album.is_playable === true)
|
|| props.artist?.albums?.some((album) => album.is_playable === true)
|
||||||
} else if (props.tracks) {
|
} else if (props.tracks) {
|
||||||
return props.tracks.some((track) => (track.uploads?.length ?? 0) > 0)
|
return props.tracks?.some((track) => (track.uploads?.length ?? 0) > 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
|
|
@ -16,7 +16,7 @@ const bodyIsActive = computed(() => activeElement.value === document.body)
|
||||||
|
|
||||||
const current = new Set()
|
const current = new Set()
|
||||||
useEventListener(window, 'keydown', (event) => {
|
useEventListener(window, 'keydown', (event) => {
|
||||||
if (!bodyIsActive.value) return
|
if (!bodyIsActive.value && !event.key) return
|
||||||
current.add(event.key.toLowerCase())
|
current.add(event.key.toLowerCase())
|
||||||
|
|
||||||
const currentArray = [...current]
|
const currentArray = [...current]
|
||||||
|
@ -29,7 +29,9 @@ useEventListener(window, 'keydown', (event) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
useEventListener(window, 'keyup', (event) => {
|
useEventListener(window, 'keyup', (event) => {
|
||||||
current.delete(event.key.toLowerCase())
|
if (!event.key) {
|
||||||
|
current.delete(event.key.toLowerCase())
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
export default (key: KeyFilter, handler: () => unknown, prevent = false) => {
|
export default (key: KeyFilter, handler: () => unknown, prevent = false) => {
|
||||||
|
|
Loading…
Reference in New Issue