Couple fixes
This commit is contained in:
parent
0b263dce71
commit
7eca32e006
|
@ -86,10 +86,6 @@ const labels = computed(() => ({
|
||||||
addArtistContentFilter: $pgettext('Sidebar/Player/Icon.Tooltip/Verb', 'Hide content from this artist…')
|
addArtistContentFilter: $pgettext('Sidebar/Player/Icon.Tooltip/Verb', 'Hide content from this artist…')
|
||||||
}))
|
}))
|
||||||
|
|
||||||
const setCurrentTime = (time: number) => {
|
|
||||||
currentTime.value = time
|
|
||||||
}
|
|
||||||
|
|
||||||
const switchTab = () => {
|
const switchTab = () => {
|
||||||
store.commit('ui/queueFocused', store.state.ui.queueFocused === 'player' ? 'queue' : 'player')
|
store.commit('ui/queueFocused', store.state.ui.queueFocused === 'player' ? 'queue' : 'player')
|
||||||
}
|
}
|
||||||
|
@ -295,7 +291,7 @@ const { width: screenWidth } = useWindowSize()
|
||||||
<template v-if="!isLoadingAudio">
|
<template v-if="!isLoadingAudio">
|
||||||
<span
|
<span
|
||||||
class="start"
|
class="start"
|
||||||
@click.stop.prevent="setCurrentTime(0)"
|
@click.stop.prevent="currentTime = 0"
|
||||||
>
|
>
|
||||||
{{ currentTimeFormatted }}
|
{{ currentTimeFormatted }}
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { ConfigField } from '~/composables/moderation/useEditConfigs'
|
||||||
import type { Review, ReviewState, ReviewStatePayload } from '~/types'
|
import type { Review, ReviewState, ReviewStatePayload } from '~/types'
|
||||||
import type { Change } from 'diff'
|
import type { Change } from 'diff'
|
||||||
|
|
||||||
|
@ -93,14 +94,21 @@ const updatedFields = computed(() => {
|
||||||
newRepr: getValueRepr(payload[id]) ?? '',
|
newRepr: getValueRepr(payload[id]) ?? '',
|
||||||
old: undefined,
|
old: undefined,
|
||||||
oldRepr: '',
|
oldRepr: '',
|
||||||
diff: [] as Change[]
|
diff: []
|
||||||
|
} as {
|
||||||
|
id: string
|
||||||
|
config: ConfigField
|
||||||
|
old?: ReviewStatePayload
|
||||||
|
new: ReviewStatePayload
|
||||||
|
oldRepr: string
|
||||||
|
newRepr: string
|
||||||
|
diff: Change[]
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state?.[id]) {
|
if (state?.[id]) {
|
||||||
const oldState = state[id]
|
const oldState = state[id]
|
||||||
console.log(oldState)
|
|
||||||
result.old = oldState
|
result.old = oldState
|
||||||
result.oldRepr = getValueRepr(typeof oldState === 'string' ? oldState : oldState?.value) ?? ''
|
result.oldRepr = getValueRepr(('value' in oldState && oldState.value) ?? oldState) ?? ''
|
||||||
|
|
||||||
// we compute the diffs between the old and new values
|
// we compute the diffs between the old and new values
|
||||||
result.diff = diffWordsWithSpace(result.oldRepr, result.newRepr)
|
result.diff = diffWordsWithSpace(result.oldRepr, result.newRepr)
|
||||||
|
|
|
@ -2,7 +2,7 @@ import type { Album, Artist, Content, Track } from '~/types'
|
||||||
|
|
||||||
import { gettext } from '~/init/locale'
|
import { gettext } from '~/init/locale'
|
||||||
|
|
||||||
interface ConfigField {
|
export interface ConfigField {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
type: 'content' | 'attachment' | 'tags' | 'text' | 'license'
|
type: 'content' | 'attachment' | 'tags' | 'text' | 'license'
|
||||||
|
|
|
@ -126,6 +126,7 @@ const store: Module<State, RootState> = {
|
||||||
async resumePlayback ({ commit, state, dispatch }) {
|
async resumePlayback ({ commit, state, dispatch }) {
|
||||||
commit('playing', true)
|
commit('playing', true)
|
||||||
if (state.errored && state.errorCount < state.maxConsecutiveErrors) {
|
if (state.errored && state.errorCount < state.maxConsecutiveErrors) {
|
||||||
|
// TODO (wvffle): Cancel whenever we skip track
|
||||||
await new Promise(resolve => setTimeout(resolve, 3000))
|
await new Promise(resolve => setTimeout(resolve, 3000))
|
||||||
if (state.playing) {
|
if (state.playing) {
|
||||||
return dispatch('queue/next', null, { root: true })
|
return dispatch('queue/next', null, { root: true })
|
||||||
|
@ -177,8 +178,8 @@ const store: Module<State, RootState> = {
|
||||||
}, 3000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateProgress ({ commit }, t) {
|
updateProgress ({ commit }, time: number) {
|
||||||
commit('currentTime', t)
|
commit('currentTime', time)
|
||||||
},
|
},
|
||||||
mute ({ commit, state }) {
|
mute ({ commit, state }) {
|
||||||
commit('tempVolume', state.volume)
|
commit('tempVolume', state.volume)
|
||||||
|
|
|
@ -400,7 +400,7 @@ export interface ReportTarget {
|
||||||
type: EntityObjectType
|
type: EntityObjectType
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ReviewStatePayload = Partial<Artist> | Partial<Album> | Partial<Track>
|
export type ReviewStatePayload = { value: unknown } | Partial<Artist> | Partial<Album> | Partial<Track>
|
||||||
export interface ReviewState {
|
export interface ReviewState {
|
||||||
[id: string]: ReviewStatePayload
|
[id: string]: ReviewStatePayload
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue