From b6d573ac2b85932ae57f45cd1a10fc53f8ba22e1 Mon Sep 17 00:00:00 2001 From: matavach Date: Sun, 4 Aug 2024 14:19:40 -0500 Subject: [PATCH] added null check for weather key (#71) * added null check for weather key * Update index.ts removed an unneeded import * Update index.ts removed more junk. I need to be better about cleaning up my code before commiting it :sweat_smile: * Update index.ts okay last one * removed visibility change, adjusted null check to still display default values * Formatting --------- Co-authored-by: Jas Singh --- modules/menus/calendar/weather/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/menus/calendar/weather/index.ts b/modules/menus/calendar/weather/index.ts index 85993b9..bdef43a 100644 --- a/modules/menus/calendar/weather/index.ts +++ b/modules/menus/calendar/weather/index.ts @@ -19,6 +19,9 @@ const WeatherWidget = () => { Utils.merge( [key.bind("value"), interval.bind("value"), location.bind("value")], (weatherKey, weatherInterval, loc) => { + if (!weatherKey) { + return theWeather.value = DEFAULT_WEATHER; + } Utils.interval(weatherInterval, () => { const formattedLocation = loc.replace(" ", "%20"); Utils.execAsync( @@ -49,7 +52,7 @@ const WeatherWidget = () => { }); }, ); - + return (self.child = Widget.Box({ vertical: true, hexpand: true,