use old system to define frontend settings
This commit is contained in:
@ -148,20 +148,15 @@ export function resolveDjangoUrl(url, params = null) {
|
||||
/*
|
||||
* other utilities
|
||||
* */
|
||||
export function getUserPreference(pref = undefined) {
|
||||
let user_preference
|
||||
if (document.getElementById("user_preference")) {
|
||||
user_preference = JSON.parse(document.getElementById("user_preference").textContent)
|
||||
} else {
|
||||
export function getUserPreference(pref) {
|
||||
if (window.USER_PREF === undefined) {
|
||||
return undefined
|
||||
}
|
||||
if (pref) {
|
||||
return user_preference[pref]
|
||||
}
|
||||
return user_preference
|
||||
return window.USER_PREF[pref]
|
||||
}
|
||||
|
||||
export function calculateAmount(amount, factor) {
|
||||
console.log('converting, getting pref' , getUserPreference("use_fractions"))
|
||||
if (getUserPreference("use_fractions")) {
|
||||
let return_string = ""
|
||||
let fraction = frac(amount * factor, 10, true)
|
||||
|
Reference in New Issue
Block a user