Skip to content

Commit

Permalink
home: Cleanup unnecessary type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrRip committed Nov 12, 2023
1 parent 3ca9466 commit 3eeefbb
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/home/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,10 @@ function viewPlaylistToggleSorting (column: PlaylistColumn) {
// Rotate between ordering options
} else {
const sortingOrderOptionIndex: number =
viewPlaylistSortingOrderOptions.value.findIndex(
(option: PlaylistSortingOrder) => viewPlaylistSortingOrder.value === option
) + 1 > viewPlaylistSortingOrderOptions.value.length - 1 ?
viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 >
viewPlaylistSortingOrderOptions.value.length - 1 ?
0 :
viewPlaylistSortingOrderOptions.value.findIndex(
(option: PlaylistSortingOrder) => viewPlaylistSortingOrder.value === option
) + 1
viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1
viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[sortingOrderOptionIndex]
}
}
Expand All @@ -429,7 +426,7 @@ const viewPlaylistData = computed<Playlist>(() => {
// Sort by song name or artist in alphabetical order
if (viewPlaylistSortingColumn.value === 'name' || viewPlaylistSortingColumn.value === 'artist') {
playlist = backendPlaylist.value.map((song: SortingSong) => {
playlist = backendPlaylist.value.map((song) => {
// @ts-ignore
song[`${viewPlaylistSortingColumn.value}Pinyin`] =
// @ts-ignore
Expand Down Expand Up @@ -489,7 +486,7 @@ const viewPlaylistCopyingFailedSongs = ref<Set<Song['$id']>>(new Set())
function viewPlaylistCopySong (id: Song['$id']) {
const clipboardWritePromise = navigator.clipboard.writeText(
// @ts-ignore
`点歌 ${backendPlaylist.value.find((song: Song) => song.$id === id).name}`
`点歌 ${backendPlaylist.value.find(song => song.$id === id).name}`
)
setTimeout(() => { if (!viewPlaylistCopiedSongs.value.has(id)) { viewPlaylistCopyingFailedSongs.value.add(id) } }, 500)
clipboardWritePromise.then(
Expand Down

0 comments on commit 3eeefbb

Please sign in to comment.