Skip to content

Commit

Permalink
fix: flash lyric update
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkontoask committed Aug 29, 2021
1 parent 3d693fe commit 093faac
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hooks/http.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactive } from 'vue'
// 有时间去迁移一下到axios

export const useHttp = (fetchFn: Function): any => {
const state = reactive({
loading: false
Expand Down
3 changes: 3 additions & 0 deletions src/interface/app.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentPublicInstance, App } from 'vue'
import { FooterMutations, RecommendMutations } from '@/interface'
import language from '@/locale/zh-cn.json'

export interface Music extends ComponentPublicInstance {
$app: App
Expand Down Expand Up @@ -66,3 +67,5 @@ export type SongListColumnsType =
| 'dlt'

export type AllMutations = FooterMutations & RecommendMutations

export type LanguageKey = typeof language
2 changes: 1 addition & 1 deletion src/pages/footer/components/music-controller/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const MusicControl = defineComponent({
audioElement.value.currentTime
)
}
requestAnimationFrame(timeUpdate)
setTimeout(timeUpdate, 0)
}

watch(
Expand Down
2 changes: 1 addition & 1 deletion src/pages/setting/sage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const mutations: MutationTree<SettingState> = {
[SettingMutations.SET_CONVOLVER_EFFECT](state, convolver) {
const { useState } = useFooterModule()
const footerState = useState()
if (convolver === $t('src__pages__setting__sage___37')) {
if (convolver === '原唱') {
footerState.effect?.clearConvolver()
} else {
footerState.effect?.createConvolver(convolver)
Expand Down
1 change: 1 addition & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ plugins.push(
'Footer.musicLyricsOrigin',
'Footer.currentTime',
'Footer.visibleLyrics',
'Footer.playMode',
'Setting',
'Download',
'LocalMusic'
Expand Down
7 changes: 6 additions & 1 deletion src/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ComponentCustomProperties } from 'vue'
import { Store } from 'vuex'
import { RootState } from '@/store/index'
import { LanguageKey } from './interface'

declare module '@vue/runtime-core' {
interface ComponentCustomProperties {
Expand All @@ -26,7 +27,11 @@ declare global {

declare const MediaMetadata: MediaMetadataType

declare const $t: (key: string, ...args: any[]) => string
declare const $t: <T extends keyof LanguageKey>(
key: T,
...args: any[]
) => LanguageKey[T]

interface Window {
isMobile: boolean
webkitAudioContext: AudioContext
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@/*": ["src/*"],
"root/*": ["./*"],
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
"lib": ["esnext", "dom", "dom.iterable", "scripthost", "es2019"]
},
"include": [
"src/**/*.ts",
Expand Down

0 comments on commit 093faac

Please sign in to comment.