Commit 9d755d1c authored by Thonier Florian's avatar Thonier Florian
Browse files

model: use correct function for warnings level

parent 41ed489a
......@@ -1660,10 +1660,10 @@ changeAlleleNotation: function(alleleNotation, update, save) {
var value = 2
if (!("code" in warn) && !("msg" in warn) && !("level" in warn) ){ // empty
return 0
} else if (warn.code != undefined){
value = this.getWarningLevelFromCode(warn.code)
} else if (warn.level == undefined){ // Old style value
value = 1
} else if (warn.code != undefined && localStorage.getItem(`warn_${warn.code}`) ) {
value = parseInt(localStorage.getItem(`warn_${warn.code}`))
} else {
value = parseInt(Object.keys(warnText).find(key => warnText[key] === warn.level))
}
......
......@@ -144,7 +144,7 @@ Warnings.prototype = {
sub.classList = " warnings_line"
// create line
var subwarn_level = localStorage.getItem(`warn_${subwarn_code}`) ? Number(localStorage.getItem(`warn_${subwarn_code}`)) : subwarn.level
var subwarn_level = this.m.getWarningLevelFromCode(subwarn_code)
var icon_class; var span_warn
if (subwarn_level == 0) {icon_class = "icon-info"; span_warn=""}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment