mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-14 03:40:36 +08:00
34 lines
735 B
JavaScript
34 lines
735 B
JavaScript
import {mergeConfig} from '@/utils'
|
|
|
|
export const DEFAULT_CONFIG = {
|
|
minGiftPrice: 7, // $1
|
|
showDanmaku: true,
|
|
showGift: true,
|
|
showGiftName: false,
|
|
mergeSimilarDanmaku: false,
|
|
mergeGift: true,
|
|
maxNumber: 60,
|
|
|
|
blockGiftDanmaku: true,
|
|
blockLevel: 0,
|
|
blockNewbie: true,
|
|
blockNotMobileVerified: true,
|
|
blockKeywords: '',
|
|
blockUsers: '',
|
|
blockMedalLevel: 0,
|
|
|
|
autoTranslate: false
|
|
}
|
|
|
|
export function setLocalConfig (config) {
|
|
config = mergeConfig(config, DEFAULT_CONFIG)
|
|
window.localStorage.config = JSON.stringify(config)
|
|
}
|
|
|
|
export function getLocalConfig () {
|
|
if (!window.localStorage.config) {
|
|
return DEFAULT_CONFIG
|
|
}
|
|
return mergeConfig(JSON.parse(window.localStorage.config), DEFAULT_CONFIG)
|
|
}
|