mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
fix duplicate weather warnings
This commit is contained in:
parent
ed20c7f96a
commit
f4a003cc55
2 changed files with 6 additions and 6 deletions
|
@ -41,9 +41,9 @@ module.exports = {
|
|||
|
||||
// Render weather alerts
|
||||
if(data.result.warnings.length >= 1){
|
||||
description += `\n`
|
||||
for(const w of data.result.warnings){
|
||||
description += `\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
for(const w of data.result.warnings.splice(0, 2)){
|
||||
if(description.includes(w.label)) continue;
|
||||
description += `\n\n${icon("warning")} **${w.label}**\n-# ${w.source} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue