瀏覽代碼

Remove unrelated units check

Svilen Markov 1 年之前
父節點
當前提交
a2bb1b88ea
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      internal/widget/weather.go

+ 2 - 2
internal/widget/weather.go

@@ -31,8 +31,8 @@ func (widget *Weather) Initialize() error {
 		widget.TimeLabels = timeLabels12h
 		widget.TimeLabels = timeLabels12h
 	} else if widget.HourFormat == "24h" {
 	} else if widget.HourFormat == "24h" {
 		widget.TimeLabels = timeLabels24h
 		widget.TimeLabels = timeLabels24h
-	} else if widget.Units != "12h" && widget.Units != "24h" {
-		return fmt.Errorf("invalid hour format '%s' for weather, must be either 12h or 24h", widget.HourFormat)
+	} else {
+		return fmt.Errorf("invalid hour format '%s' for weather widget, must be either 12h or 24h", widget.HourFormat)
 	}
 	}
 
 
 	if widget.Units == "" {
 	if widget.Units == "" {