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 😅 * Update index.ts okay last one * removed visibility change, adjusted null check to still display default values * Formatting --------- Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user