Fix composables calling `useI18n` too early
This commit is contained in:
parent
db426863d4
commit
a0c9fdee78
|
@ -49,12 +49,12 @@ export default (props: PlayOptionsProps) => {
|
|||
const filterableArtist = computed(() => props.track?.artist ?? props.album?.artist ?? props.artist)
|
||||
const filterArtist = async () => store.dispatch('moderation/hide', { type: 'artist', target: filterableArtist.value })
|
||||
|
||||
const { t } = useI18n()
|
||||
const addMessage = (tracks: Track[]) => {
|
||||
if (!tracks.length) {
|
||||
return
|
||||
}
|
||||
|
||||
const { t } = useI18n()
|
||||
store.commit('ui/addMessage', {
|
||||
content: t('composables.audio.usePlayOptions.addToQueueMessage', tracks.length),
|
||||
date: new Date()
|
||||
|
|
|
@ -20,9 +20,12 @@ export type EditObject = (Partial<Artist> | Partial<Album> | Partial<Track>) & {
|
|||
export type EditObjectType = 'artist' | 'album' | 'track'
|
||||
type Configs = Record<EditObjectType, { fields: (EditableConfigField|ConfigField)[] }>
|
||||
|
||||
const { t } = useI18n()
|
||||
const getContentValueRepr = (val: Content) => val.text
|
||||
|
||||
// TODO: Get params from typescript type somehow?
|
||||
export default (): Configs => {
|
||||
const { t } = useI18n()
|
||||
|
||||
const description: ConfigField = {
|
||||
id: 'description',
|
||||
type: 'content',
|
||||
|
@ -49,8 +52,7 @@ const tags: ConfigField = {
|
|||
getValueRepr: (tags: string[]) => tags.slice().sort().join('\n')
|
||||
}
|
||||
|
||||
// TODO: Get params from typescript type somehow?
|
||||
export default (): Configs => ({
|
||||
return {
|
||||
artist: {
|
||||
fields: [
|
||||
{
|
||||
|
@ -122,4 +124,5 @@ export default (): Configs => ({
|
|||
tags
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ export interface Entity {
|
|||
|
||||
type Configs = Record<EntityObjectType, Entity>
|
||||
|
||||
export default (): Configs => {
|
||||
const { t } = useI18n()
|
||||
|
||||
const tags: ModeratedField = {
|
||||
|
@ -50,7 +51,7 @@ const visibility: ModeratedField = {
|
|||
label: t('composables.moderation.useReportConfigs.visibility.label')
|
||||
}
|
||||
|
||||
export default (): Configs => ({
|
||||
return {
|
||||
artist: {
|
||||
label: t('composables.moderation.useReportConfigs.artist.label'),
|
||||
icon: 'users',
|
||||
|
@ -181,4 +182,5 @@ export default (): Configs => ({
|
|||
tags
|
||||
]
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue