mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
fix issue with rendering logic in weather card
This commit is contained in:
parent
e326988896
commit
edd2ef52d2
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ function renderWeatherCard(context, data, units){
|
|||
|
||||
// Render weather alerts
|
||||
if(data.result.warnings.length >= 1){
|
||||
for(const w of data.result.warnings.splice(0, 1)){
|
||||
for(const w of [data.result.warnings[0]]){
|
||||
if(description.includes(stringwrap(w.label, 50))) continue;
|
||||
description += `\n\n${icon("weather_warning_" + (w.icon || "generic").toLowerCase())} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ function renderWeatherCard(context, data, units){
|
|||
|
||||
// Render weather alerts
|
||||
if(data.result.warnings.length >= 1){
|
||||
for(const w of data.result.warnings.splice(0, 1)){
|
||||
for(const w of [data.result.warnings[0]]){
|
||||
if(description.includes(stringwrap(w.label, 50))) continue;
|
||||
description += `\n\n${icon("weather_warning_" + (w.icon || "generic").toLowerCase())} **${stringwrap(w.label, 50)}**\n-# ${stringwrap(w.source, 50)} • ${link(w.url, "Learn More", "Learn more about this alert")}`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue