fix pargar mande
This commit is contained in:
@@ -24,6 +24,18 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
return item?.value ?? null
|
||||
}
|
||||
|
||||
function isSettingTruthy(key: string) {
|
||||
const value = getSettingByKey(key)
|
||||
if (value == null) {
|
||||
return false
|
||||
}
|
||||
if (value === true) {
|
||||
return true
|
||||
}
|
||||
const normalized = String(value).trim().toLowerCase()
|
||||
return normalized === 'true' || normalized === '1' || normalized === 'yes'
|
||||
}
|
||||
|
||||
function mergeSettings(items?: AppSetting[] | null) {
|
||||
if (!items?.length) {
|
||||
return
|
||||
@@ -80,6 +92,7 @@ export const useSettingsStore = defineStore('settings', () => {
|
||||
fetchSettings,
|
||||
mergeSettings,
|
||||
getSettingByKey,
|
||||
isSettingTruthy,
|
||||
metalTypeSettingValue,
|
||||
metalTypeLabel,
|
||||
meltedGoldLabel,
|
||||
|
||||
Reference in New Issue
Block a user