diff --git a/packages/admin/app/components/playlist/MainList.vue b/packages/admin/app/components/playlist/MainList.vue index ccbc769..27eb1c5 100644 --- a/packages/admin/app/components/playlist/MainList.vue +++ b/packages/admin/app/components/playlist/MainList.vue @@ -404,7 +404,7 @@ function modifyNext (currentTarget: ModifyTarget) { const fields: Array = ['name', 'artist', 'payment_amount', 'language'] modifyingInput.value?.[0]?.blur() modifyingTarget.value.id = currentTarget.id - modifyingTarget.value.field = fields[fields.findIndex(field => field === currentTarget.field) + 1] + modifyingTarget.value.field = fields[fields.findIndex(field => field === currentTarget.field) + 1] ?? null nextTick(() => modifyingInput.value?.[0]?.focus()) } diff --git a/packages/admin/app/pages/playlist.vue b/packages/admin/app/pages/playlist.vue index f6fe0e8..8ce15a5 100644 --- a/packages/admin/app/pages/playlist.vue +++ b/packages/admin/app/pages/playlist.vue @@ -102,15 +102,18 @@ function backendPlaylistPublishChanges (changesIds: Set) { ) function cleanup (changesId: Song['$id'], newId?: Song['$id']) { + // @ts-expect-error backendPlaylistPublishChangesState.value[ backendPlaylistPublishChangesState.value.findIndex(_ => _.$id === changesId) ].state = 'succeeded' if (newId) { + // @ts-expect-error backendPlaylistPublishChangesState.value[ backendPlaylistPublishChangesState.value.findIndex(_ => _.$id === changesId) ].newId = newId } else { + // @ts-expect-error backendPlaylistPublishChangesState.value[ backendPlaylistPublishChangesState.value.findIndex(_ => _.$id === changesId) // @ts-expect-error @@ -119,7 +122,9 @@ function backendPlaylistPublishChanges (changesIds: Set) { } function fail (changesId: Song['$id'], error: AppwriteException) { const changesPublishStateIndex = backendPlaylistPublishChangesState.value.findIndex(_ => _.$id === changesId) + // @ts-expect-error backendPlaylistPublishChangesState.value[changesPublishStateIndex].state = 'failed' + // @ts-expect-error backendPlaylistPublishChangesState.value[changesPublishStateIndex].error = error } function backendPlaylistRefreshIfAllPublishingFinished () { @@ -128,10 +133,13 @@ function backendPlaylistPublishChanges (changesIds: Set) { .then(() => { backendPlaylistPublishChangesState.value.forEach((_, index) => { if (!_.newId) { return } + // @ts-expect-error viewPlaylistChangesData.value[ viewPlaylistChangesData.value.findIndex(changes => changes.$id === _.$id) ].$id = _.newId + // @ts-expect-error backendPlaylistPublishChangesState.value[index].$id = _.newId + // @ts-expect-error delete backendPlaylistPublishChangesState.value[index].newId }) }) @@ -189,6 +197,7 @@ function viewPlaylistToggleSorting (column: PlaylistColumn) { // Enable sorting or switch to another column if (viewPlaylistSortingColumn.value === null || column !== viewPlaylistSortingColumn.value) { viewPlaylistSortingColumn.value = column + // @ts-expect-error viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[0] } else @@ -198,16 +207,15 @@ function viewPlaylistToggleSorting (column: PlaylistColumn) { viewPlaylistSortingOrder.value === viewPlaylistSortingOrderOptions.value[viewPlaylistSortingOrderOptions.value.length - 1] ) { viewPlaylistSortingColumn.value = null + // @ts-expect-error viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[0] - // Rotate between ordering options } + // Rotate between ordering options else { - const sortingOrderOptionIndex: number = - viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 > - viewPlaylistSortingOrderOptions.value.length - 1 ? - 0 : - viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 - viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[sortingOrderOptionIndex] + // @ts-expect-error + viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[ + viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 + ] } viewPlaylistDataUpdate() } diff --git a/packages/home/app/app.vue b/packages/home/app/app.vue index 60b928e..9e3cb56 100644 --- a/packages/home/app/app.vue +++ b/packages/home/app/app.vue @@ -327,6 +327,7 @@ function viewPlaylistToggleSorting (column: PlaylistColumn) { // Enable sorting or switch to another column if (viewPlaylistSortingColumn.value === null || column !== viewPlaylistSortingColumn.value) { viewPlaylistSortingColumn.value = column + // @ts-expect-error viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[0] } else @@ -336,16 +337,15 @@ function viewPlaylistToggleSorting (column: PlaylistColumn) { viewPlaylistSortingOrder.value === viewPlaylistSortingOrderOptions.value[viewPlaylistSortingOrderOptions.value.length - 1] ) { viewPlaylistSortingColumn.value = null + // @ts-expect-error viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[0] } // Rotate between ordering options else { - const sortingOrderOptionIndex: number = - viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 > - viewPlaylistSortingOrderOptions.value.length - 1 ? - 0 : - viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 - viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[sortingOrderOptionIndex] + // @ts-expect-error + viewPlaylistSortingOrder.value = viewPlaylistSortingOrderOptions.value[ + viewPlaylistSortingOrderOptions.value.findIndex(option => option === viewPlaylistSortingOrder.value) + 1 + ] } viewPlaylistDataUpdate(['sort']) }