kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
fix(front): Move key extractor into datastore
rodzic
f7d9fdf58e
commit
963fa22499
|
@ -4,7 +4,6 @@ import { useUploadsStore } from '../stores/upload'
|
|||
import { useI18n } from 'vue-i18n'
|
||||
import { useStore } from '~/store'
|
||||
import { useModal } from '~/ui/composables/useModal.ts'
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
import Logo from '~/components/Logo.vue'
|
||||
import UserMenu from './UserMenu.vue'
|
||||
|
@ -15,13 +14,9 @@ import PopoverItem from '~/components/ui/popover/PopoverItem.vue'
|
|||
import Button from '~/components/ui/Button.vue'
|
||||
import Layout from '~/components/ui/Layout.vue'
|
||||
import Spacer from '~/components/ui/Spacer.vue'
|
||||
import SearchModal from '~/ui/modals/Search.vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
// simple usage
|
||||
const SearchModal = defineAsyncComponent({
|
||||
loader: () => import('~/ui/modals/Search.vue')
|
||||
})
|
||||
|
||||
const isCollapsed = ref(true)
|
||||
|
||||
const route = useRoute()
|
||||
|
|
|
@ -12,8 +12,7 @@ import useErrorHandler from '~/composables/useErrorHandler'
|
|||
import { useI18n } from 'vue-i18n'
|
||||
import { useModal } from '~/ui/composables/useModal.ts'
|
||||
import { useStore } from '~/store'
|
||||
import { getKey } from '~/rstore/model'
|
||||
import { useDataStore } from '~/ui/stores/data'
|
||||
import { useDataStore, getKey } from '~/ui/stores/data'
|
||||
|
||||
import ArtistCard from '~/components/artist/Card.vue'
|
||||
import PlaylistCard from '~/components/playlists/Card.vue'
|
||||
|
|
|
@ -14,6 +14,11 @@ import type { Album, Artist, Tag, Track } from '~/types'
|
|||
|
||||
const logger = useLogger()
|
||||
|
||||
/** @returns the most unique identifier available per item, assuming every item has at least one key field */
|
||||
export const getKey = (item: { fid: string } | { artist: { fid: string } } | { id: number } | { name: string }) =>
|
||||
'fid' in item ? item.fid : 'artist' in item ? item.artist.fid : 'id' in item ? item.id.toString() : item.name
|
||||
|
||||
|
||||
// ======================================================================
|
||||
// Object names
|
||||
const names = [
|
||||
|
|
Ładowanie…
Reference in New Issue