From 8cb58784ab6cc1007cb0936ef9db72aa17748885 Mon Sep 17 00:00:00 2001 From: davfsa Date: Fri, 17 Jan 2025 11:16:36 +0100 Subject: [PATCH] Fix weather api call when query has multiple spaces --- src/globals/weather.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/globals/weather.ts b/src/globals/weather.ts index 5daa1d91b..239a92fdd 100644 --- a/src/globals/weather.ts +++ b/src/globals/weather.ts @@ -33,7 +33,7 @@ const getWeatherKey = (apiKey: string): string => { const fileContent = new TextDecoder().decode(fileContentArray); if (!fileContent) { - console.error('File content is empty'); + console.error('weather_api_key file is empty'); return ''; } @@ -69,7 +69,7 @@ const weatherIntervalFn = (weatherInterval: number, loc: string, weatherKey: str weatherIntervalInstance.cancel(); } - const formattedLocation = loc.replace(' ', '%20'); + const formattedLocation = loc.replaceAll(' ', '%20'); weatherIntervalInstance = interval(weatherInterval, () => { execAsync(