优化代码逻辑,修复潜在播放问题
This commit is contained in:
@@ -36,7 +36,7 @@ exports.createThemeColors = (rgbaColor, fontRgbaColor, isDark) => {
|
||||
const createFontColors = (rgbaColor, isDark) => {
|
||||
// rgb(238, 238, 238)
|
||||
// let prec = 'rgb(255, 255, 255)'
|
||||
if (rgbaColor == null) rgbaColor = isDark ? 'rgb(229, 229, 229)' : 'rgb(33, 33, 33)'
|
||||
rgbaColor ??= isDark ? 'rgb(229, 229, 229)' : 'rgb(33, 33, 33)'
|
||||
if (isDark) return createFontDarkColors(rgbaColor)
|
||||
|
||||
let colors = {
|
||||
|
||||
@@ -141,7 +141,7 @@ module.exports = class FontPlayer {
|
||||
// lineText += text
|
||||
|
||||
if (this.shadowContent) {
|
||||
if (!lrcShadowContent) lrcShadowContent = document.createElement('div')
|
||||
lrcShadowContent ??= document.createElement('div')
|
||||
const shadowDom = document.createElement('span')
|
||||
shadowDom.textContent = text
|
||||
lrcShadowContent.appendChild(shadowDom)
|
||||
|
||||
@@ -25,7 +25,7 @@ export default (setting: any): Partial<LX.AppSetting> => {
|
||||
// 迁移列表滚动位置设置 ~0.18.3
|
||||
if (setting.list?.scroll) {
|
||||
let scroll = setting.list.scroll
|
||||
if (setting.list.isSaveScrollLocation) setting.list.isSaveScrollLocation = scroll.enable
|
||||
setting.list.isSaveScrollLocation &&= scroll.enable
|
||||
delete setting.list.scroll
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +244,7 @@ export const scrollXRTo = (element: HTMLElement, to: number, duration = 300, fn
|
||||
*/
|
||||
let dom_title = document.getElementsByTagName('title')[0]
|
||||
export const setTitle = (title: string | null) => {
|
||||
if (!title) title = '洛雪音乐助手'
|
||||
title ||= '洛雪音乐助手'
|
||||
dom_title.innerText = title
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user